set(ALL_FMTS ${MINIMAL_FMTS}
brauniger_iq.cc
dg-100.cc
- dmtlog.cc
exif.cc
garmin_fit.cc
garmin_gpi.cc
html.cc
humminbird.cc
igc.cc
- itracku.cc
lowranceusr.cc
mtk_logger.cc
navilink.cc
- navitel.cc
osm.cc
ozi.cc
qstarz_bl_1000.cc
random.cc
- raymarine.cc
sbn.cc
sbp.cc
shape.cc
skytraq.cc
subrip.cc
- tef_xml.cc
- teletype.cc
text.cc
- tomtom.cc
tpg.cc
tpo.cc
unicsv.cc
v900.cc
vcf.cc
- wintec_tes.cc
xcsv.cc
- xol.cc
)
# ALL_FMTS = $$MINIMAL_FMTS
skytraq.h
strptime.h
subrip.h
- tef_xml.h
- teletype.h
text.h
unicsv.h
units.h
vecs.h
- wintec_tes.h
xcsv.h
xmlgeneric.h
jeeps/garminusb.h
classic-2
classic-3
dg100
- dmtlog
- dna
dop_filter
duplicate
exif
iblue747
igc
interpolate
- itracku
kml-read
kml
lowranceusr
mtk
multiurlgpx
navilink
- navitel
nmea
osm
ozi
position
qstarz_bl_1000
radius
- raymarine
realtime
resample
route_reverse
stackfilter
subrip
swap
- teletype
text
- tomtom_asc
- tomtom_itn
- tomtom
tpg
tpo
track-discard
validate_formats
validate
vcard
- wintec_tes
xcsv
- xol
)
list(SORT TESTS)
ALL_FMTS = $$MINIMAL_FMTS \
brauniger_iq.cc \
dg-100.cc \
- dmtlog.cc \
exif.cc \
f90g_track.cc \
garmin_fit.cc \
html.cc \
humminbird.cc \
igc.cc \
- itracku.cc \
lowranceusr.cc \
mtk_logger.cc \
navilink.cc \
- navitel.cc \
osm.cc \
ozi.cc \
qstarz_bl_1000.cc \
random.cc \
- raymarine.cc \
sbn.cc \
sbp.cc \
shape.cc \
skytraq.cc \
subrip.cc \
- tef_xml.cc \
- teletype.cc \
text.cc \
- tomtom.cc \
tpg.cc \
tpo.cc \
unicsv.cc \
v900.cc \
vcf.cc \
- wintec_tes.cc \
xcsv.cc \
- xol.cc
# ALL_FMTS = $$MINIMAL_FMTS
skytraq.h \
strptime.h \
subrip.h \
- tef_xml.h \
- teletype.h \
text.h \
unicsv.h \
units.h \
vecs.h \
- wintec_tes.h \
xcsv.h \
xmlgeneric.h \
jeeps/garminusb.h \
You may find format_skeleton.c and filter_skeleton.c in the source tree
to be helpful examples. Just add meat!
-Prefer Qt objects/classes to ISO C/POSIX services.
- * QStrings are reference counted, implicitly shared, and have a
- robust supporting library.
- * QDateTime supports sub-second time and a range of dates far
- beyond 1970->2038 and are much more pleasant to work with
- than ctime/mktime/struct tm.
+Prefer Qt objects/classes to ISO C/POSIX services.
+ * QStrings are reference counted, implicitly shared, and have a
+ robust supporting library.
+ * QDateTime supports sub-second time and a range of dates far
+ beyond 1970->2038 and are much more pleasant to work with
+ than ctime/mktime/struct tm.
* QXmlStreamReader and Writer eliminate the need to explictly quote data.
"But I see strcpy, sprintf, and struct tm and such in the code!" It's
-true; GPSBabel is a tenured project of well over ten years. We have
-code that predates our move to C++/Qt that isn't well tested or has a
-low payoff to modernize and uses old constructs. Our actively
-maintained/strategic formats like GPX and KML tend to be better
+true; GPSBabel is a tenured project of well over ten years. We have
+code that predates our move to C++/Qt that isn't well tested or has a
+low payoff to modernize and uses old constructs. Our actively
+maintained/strategic formats like GPX and KML tend to be better
examples of modern programming and are generally better models to
follow. New code shouldn't be using xstrdup and gbfprintf.
GPSBabel.
* Makefile.in - an updated Makefile telling the compiler how to build and link
your conversion into GPSBabel
-* testo.d/$TARGET - an updated script that tests your conversion (this should
+* testo.d/$TARGET - an updated script that tests your conversion (this should
produce no output if all is good, see the current testo script for examples)
* YourOutput - a sample file of code produced by your function (used in testo
and lives in a directory called "reference").
Documentation
-------------
-HTML and text documentation are generated automatically from DocBook
-source located in the "xmldoc" directory. That directory contains
+HTML and text documentation are generated automatically from DocBook
+source located in the "xmldoc" directory. That directory contains
two subdirectories of interest: "formats" and "filters". If your
contribution adds or affects a format, you'll want to be in the "formats"
directory. Otherwise, you'll want to be in the "filters" directory.
You should contribute a file called "yourname.xml", where "yourname" is the
-name you would give on the command-line to invoke your new format or filter.
+name you would give on the command-line to invoke your new format or filter.
For example, the arc filter is documented in "filters/arc.xml".
-This file contains a general description of your format or filter, any
-limitations in your support for it, and anything else the end user should
-know. For file formats, links to manufacturers' websites are encouraged.
-The contents of this file are not valid or even well-formed XML on their own;
-they are included into a larger framework. If you know DocBook, you should
+This file contains a general description of your format or filter, any
+limitations in your support for it, and anything else the end user should
+know. For file formats, links to manufacturers' websites are encouraged.
+The contents of this file are not valid or even well-formed XML on their own;
+they are included into a larger framework. If you know DocBook, you should
ensure that the contents of this file will validate if included in a <section>.
-If you do not know DocBook, see the other files in this directory for examples
-or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags
-of interest will almost certainly include <para> for paragraphs,
-<ulink url="..."> for web links, and <screen format="linespecific"> for
+If you do not know DocBook, see the other files in this directory for examples
+or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags
+of interest will almost certainly include <para> for paragraphs,
+<ulink url="..."> for web links, and <screen format="linespecific"> for
example command lines.
For each option supported by your format or filter, you should also contribute
a file in the "options" subdirectory called "yourname-youroption.xml", again
-using the names you would use on the command line to invoke your format or
+using the names you would use on the command line to invoke your format or
filter with that particular option. For example, the "distance" option to the
-"arc" filter is documented in "filters/options/arc-distance.xml". These
+"arc" filter is documented in "filters/options/arc-distance.xml". These
files are similar to the general description above, and should meet the same
validation requirements.
-As of this writing, there are two formats that violate this rule: Magellan
+As of this writing, there are two formats that violate this rule: Magellan
serial and Microsoft Streets & Trips. Because those formats have the same
names as other formats, their descriptions are located in "magellan1.xml" and
"msroute1.xml" respectively. These are special cases, and you should do your
--- /dev/null
+/*
+
+ Support for TrackLogs digital mapping (.trl) files,
+
+ Copyright (C) 2006,2007 Olaf Klein, o.b.klein@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+#include <cstdio> // for SEEK_CUR, size_t
+#include <cstdint> // int32_t, int16_t, uint32_t
+#include <cstdlib> // for atoi
+#include <cstring> // for strncmp, memcpy, strcmp, strlen
+
+#include <QByteArray> // for QByteArray
+#include <QString> // for QString, operator+
+#include <QXmlStreamAttributes> // for QXmlStreamAttributes
+#include <QtGlobal> // for qPrintable
+
+#include "defs.h"
+#include "gbfile.h" // for gbfgetdbl, gbfgetint32, gbfputint32, gbfgetint16, gbfputdbl, gbfputc, gbfread, gbfseek, gbfgetc, gbfile, gbfclose, gbfungetc, gbfeof, gbfputs, gbfwrite, gbfopen_le, gbfgetuint32, gbfputuint16, gbfputuint32
+#include "jeeps/gpsmath.h" // for GPS_Lookup_Datum_Index, GPS_Math_Known_Datum_To_WGS84_C, GPS_Math_NGENToAiry1830LatLon
+#include "src/core/logging.h" // for FatalMsg
+#include "xmlgeneric.h" // for cb_cdata, xg_callback, xg_string, xml_deinit, xml_init, cb_end, cb_start, xg_cb_type, xml_read, xml_readstring, xg_tag_mapping
+
+
+#define MYNAME "dmtlog"
+
+#define DEFLATE_BUFF_SIZE 16384
+
+static gbfile* fin, *fout;
+
+static char* xmlbin;
+static Waypoint* xmlwpt;
+static route_head* xmltrk;
+static QString xmlgrid;
+static int xmldatum;
+static double xmlEasting, xmlNorthing;
+static double xmlLatitude, xmlLongitude;
+static double xmlAltitude;
+
+#if !ZLIB_INHIBITED
+static int xmlbinsize;
+#endif
+
+static char header_written;
+static char* opt_index;
+static int track_index, this_index;
+
+static
+QVector<arglist_t> dmtlog_args = {
+ {
+ "index", &opt_index,
+ "Index of track (if more than one in source)", "1", ARGTYPE_INT, "1", nullptr, nullptr
+ },
+};
+
+
+#if !ZLIB_INHIBITED
+static xg_callback tlog3a_xgcb_version, tlog3a_xgcb_length, tlog3a_xgcb_data;
+
+static xg_tag_mapping tlog3a_xgcb_map[] = {
+ { tlog3a_xgcb_version, cb_cdata, "/CXMLSafe/Version" },
+ { tlog3a_xgcb_length, cb_cdata, "/CXMLSafe/Length" },
+ { tlog3a_xgcb_data, cb_cdata, "/CXMLSafe/Data" },
+ { nullptr, (xg_cb_type)0, nullptr}
+};
+#endif
+
+static xg_callback tlog3b_xgcb_tfna, tlog3b_xgcb_tfdes;
+static xg_callback tlog3b_xgcb_wptst, tlog3b_xgcb_tptst;
+static xg_callback tlog3b_xgcb_tpten, tlog3b_xgcb_wpten;
+static xg_callback tlog3b_xgcb_wptid, tlog3b_xgcb_wptdt;
+static xg_callback tlog3b_xgcb_wptgr, tlog3b_xgcb_wptea;
+static xg_callback tlog3b_xgcb_wptno, tlog3b_xgcb_wptal;
+static xg_callback tlog3b_xgcb_tptdt;
+
+static xg_tag_mapping tlog3b_xgcb_map[] = {
+ { tlog3b_xgcb_tfna, cb_cdata, "/CTrackFile/Name" },
+ { tlog3b_xgcb_tfdes, cb_cdata, "/CTrackFile/Description" },
+ { tlog3b_xgcb_wptst, cb_start, "/CTrackFile/CWayPoint" },
+ { tlog3b_xgcb_wptid, cb_cdata, "/CTrackFile/CWayPoint/Id" },
+ { tlog3b_xgcb_wptdt, cb_cdata, "/CTrackFile/CWayPoint/Datum" },
+ { tlog3b_xgcb_wptgr, cb_cdata, "/CTrackFile/CWayPoint/Grid" },
+ { tlog3b_xgcb_wptea, cb_cdata, "/CTrackFile/CWayPoint/Easting" },
+ { tlog3b_xgcb_wptno, cb_cdata, "/CTrackFile/CWayPoint/Northing" },
+ { tlog3b_xgcb_wptal, cb_cdata, "/CTrackFile/CWayPoint/Altitude" },
+ { tlog3b_xgcb_wpten, cb_end, "/CTrackFile/CWayPoint" },
+ { tlog3b_xgcb_tptst, cb_start, "/CTrackFile/CTrackPoint" },
+ { tlog3b_xgcb_wptid, cb_cdata, "/CTrackFile/CTrackPoint/Id" },
+ { tlog3b_xgcb_tptdt, cb_cdata, "/CTrackFile/CTrackPoint/Datum" },
+ { tlog3b_xgcb_wptgr, cb_cdata, "/CTrackFile/CTrackPoint/Grid" },
+ { tlog3b_xgcb_wptea, cb_cdata, "/CTrackFile/CTrackPoint/Easting" },
+ { tlog3b_xgcb_wptno, cb_cdata, "/CTrackFile/CTrackPoint/Northing" },
+ { tlog3b_xgcb_wptal, cb_cdata, "/CTrackFile/CTrackPoint/Altitude" },
+ { tlog3b_xgcb_tpten, cb_end, "/CTrackFile/CTrackPoint" },
+ { nullptr, (xg_cb_type)0, nullptr}
+};
+
+/* helpers */
+
+static void
+convert_datum(Waypoint* wpt, int datum)
+{
+ if (datum != DATUM_WGS84) {
+ double lat = wpt->latitude;
+ double lon = wpt->longitude;
+ double alt = wpt->altitude;
+ GPS_Math_Known_Datum_To_WGS84_C(lat, lon, alt,
+ &wpt->latitude, &wpt->longitude, &wpt->altitude,
+ datum);
+ }
+}
+
+
+static void
+finalize_pt(Waypoint* wpt)
+{
+ if (xmlgrid == "BNG") {
+ GPS_Math_NGENToAiry1830LatLon(xmlEasting, xmlNorthing,
+ &wpt->latitude, &wpt->longitude);
+ xmldatum = DATUM_OSGB36;
+ } else {
+ wpt->latitude = xmlLatitude;
+ wpt->longitude = xmlLongitude;
+ }
+ /* NOTE:
+ * Alan White reports this program actually subtracts a number
+ * of meters ranging between 46 and 50 meters. It appears to be
+ * constant for each location, but different without an obvious
+ * correlation to ground altitude. We considered offsetting this
+ * in GPSBabel, but concluded it wasn't worth the bother.
+ * If we get complaints, probably all of our alt reading and writing
+ * should offset an average of 46m or so.
+ */
+ wpt->altitude = xmlAltitude;
+ convert_datum(wpt, xmldatum);
+}
+
+/* xml-reader callbacks */
+
+#if !ZLIB_INHIBITED
+static void
+tlog3a_xgcb_version(xg_string args, const QXmlStreamAttributes*)
+{
+ if (args != "1") {
+ fatal(MYNAME ": Unsupported file version '%s'!\n", qPrintable(args));
+ }
+}
+
+static void
+tlog3a_xgcb_length(xg_string, const QXmlStreamAttributes*)
+{
+}
+
+static void
+tlog3a_xgcb_data(xg_string args, const QXmlStreamAttributes*)
+{
+ int len;
+ char* bin;
+ char* cin, *cout;
+ char cl, ch;
+ //TODO This function needs rethinking.
+ len = args.length();
+ bin = (char*) xmalloc((len >> 1) + 1);
+
+ char* cincopy = xstrdup(args);
+ cin = cincopy;
+ cout = bin;
+
+ cl = 0x10;
+ while (*cin) {
+ char c = *cin++;
+
+ if (c == '\0') {
+ break;
+ } else if ((c >= 'A') && (c <= 'F')) {
+ c -= 'A' - 10;
+ } else if ((c >= 'a') && (c <= 'f')) {
+ c -= 'a' - 10;
+ } else if ((c >= '0') && (c <= '9')) {
+ c -= '0';
+ } else {
+ continue;
+ }
+
+ if (cl == 0x10) {
+ cl = c;
+ } else {
+ ch = (cl << 4) | c;
+ *cout++ = ch;
+ cl = 0x10;
+ }
+ }
+ xmlbin = bin;
+ xmlbinsize = (cout - bin);
+ xfree(cincopy);
+}
+#endif
+
+
+static void
+tlog3b_xgcb_tfna(xg_string args, const QXmlStreamAttributes*)
+{
+ if (xmltrk == nullptr) {
+ xmltrk = new route_head;
+ track_add_head(xmltrk);
+ }
+ xmltrk->rte_name = args;
+}
+
+
+static void
+tlog3b_xgcb_tfdes(xg_string args, const QXmlStreamAttributes*)
+{
+ if (xmltrk == nullptr) {
+ xmltrk = new route_head;
+ track_add_head(xmltrk);
+ }
+ xmltrk->rte_desc = args;
+}
+
+
+static void
+tlog3b_xgcb_wptst(xg_string, const QXmlStreamAttributes*)
+{
+ xmlwpt = new Waypoint;
+ xmldatum = DATUM_WGS84;
+}
+
+
+static void
+tlog3b_xgcb_tptst(xg_string, const QXmlStreamAttributes*)
+{
+ xmlwpt = new Waypoint;
+ xmldatum = DATUM_WGS84;
+}
+
+
+static void
+tlog3b_xgcb_tpten(xg_string, const QXmlStreamAttributes*)
+{
+ finalize_pt(xmlwpt);
+
+ if (xmltrk == nullptr) {
+ xmltrk = new route_head;
+ track_add_head(xmltrk);
+ }
+ track_add_wpt(xmltrk, xmlwpt);
+ xmlwpt = nullptr;
+}
+
+
+static void
+tlog3b_xgcb_wptid(xg_string args, const QXmlStreamAttributes*)
+{
+ xmlwpt->shortname = args;
+}
+
+
+static void
+tlog3b_xgcb_wptdt(xg_string args, const QXmlStreamAttributes*)
+{
+ xmldatum = GPS_Lookup_Datum_Index(args);
+}
+
+
+static void
+tlog3b_xgcb_wptgr(xg_string args, const QXmlStreamAttributes*)
+{
+ xmlgrid = args;
+/*
+ if (xmlgrid != NULL) {
+ if (strcmp(xmlgrid, args) == 0) {
+ return;
+ }
+ xfree(xmlgrid);
+ }
+ xmlgrid = xstrdup(args);
+*/
+}
+
+
+static void
+tlog3b_xgcb_wptno(xg_string args, const QXmlStreamAttributes*)
+{
+ xmlNorthing = args.toDouble();
+}
+
+static void
+tlog3b_xgcb_wptea(xg_string args, const QXmlStreamAttributes*)
+{
+ xmlEasting = args.toDouble();
+}
+
+
+static void
+tlog3b_xgcb_wptal(xg_string args, const QXmlStreamAttributes*)
+{
+ xmlAltitude = args.toDouble();
+}
+
+
+static void
+tlog3b_xgcb_tptdt(xg_string args, const QXmlStreamAttributes*)
+{
+ xmldatum = GPS_Lookup_Datum_Index(args);
+}
+
+
+static void
+tlog3b_xgcb_wpten(xg_string, const QXmlStreamAttributes*)
+{
+ finalize_pt(xmlwpt);
+ waypt_add(xmlwpt);
+ xmlwpt = nullptr;
+}
+
+
+static QString
+read_str(gbfile* f)
+{
+ int i = gbfgetc(f);
+ if (i == 0xff) {
+ i = gbfgetint16(f);
+ }
+
+ return gbfreadbuf(i, f);
+}
+
+static void
+write_str(const char* str, gbfile* f)
+{
+ if (str && *str) {
+ int len = strlen(str);
+ if (len > 0xfe) {
+#if 0
+ if (len > 0x7fff) {
+ len = 0x7fff;
+ }
+ gbfputc((unsigned char) 0xff, f);
+ gbfputint16(len, f);
+#else
+ len = 0xfe;
+ gbfputc(len, f);
+#endif
+ } else {
+ gbfputc(len, f);
+ }
+ gbfwrite(str, len, 1, f);
+ } else {
+ gbfputc(0, f);
+ }
+}
+
+static void
+write_str(const QString& str, gbfile* f)
+{
+ write_str(CSTR(str), f);
+}
+
+static int
+read_datum(gbfile* f)
+{
+ auto d = read_str(f);
+ auto g = read_str(f);
+
+ int res = GPS_Lookup_Datum_Index(d);
+
+ if (d.compare(g)) {
+ fatal(FatalMsg() << MYNAME << ": Unsupported combination of datum '" << d << "' and grid '" << g << "''!\n");
+ }
+
+ return res;
+}
+
+
+static void
+read_CTrackFile(const int version)
+{
+ int16_t u1 = gbfgetint16(fin);
+
+ char buf[128];
+ gbfread(buf, 1, 10, fin);
+ if ((u1 != 0x0a) || (strncmp("CTrackFile", buf, 10) != 0)) {
+ fatal(MYNAME ": Unknown or invalid track file.\n");
+ }
+
+ if (version == 8) {
+ gbfseek(fin, 36, SEEK_CUR); /* skip unknown 36 bytes */
+ }
+
+ int32_t ver = gbfgetint32(fin);
+ if (ver != version) {
+ fatal(MYNAME ": Unknown or invalid track file (%d).\n", ver);
+ }
+
+ (void) gbfgetint32(fin); // Unknown 2
+ (void) gbfgetint32(fin); // Unknown 3
+ (void) gbfgetint32(fin); // Unknown 4
+
+ auto* track = new route_head;
+ track_add_head(track);
+
+ /* S1 .. S9: comments, hints, jokes, aso */
+ for (int i = 0; i < 9; i++) {
+ (void) read_str(fin);
+ }
+
+ int32_t tcount = gbfgetint32(fin);
+ int datum = 118;
+ if (tcount > 0) {
+ datum = read_datum(fin);
+ if (version == 8) {
+ gbfread(buf, 1, 4, fin);
+ int len = gbfgetint16(fin);
+ gbfseek(fin, len, SEEK_CUR);
+ }
+ }
+
+ while (tcount > 0) {
+ tcount--;
+
+ if (version == 8) {
+ datum = read_datum(fin);
+ }
+
+ auto* wpt = new Waypoint;
+
+ wpt->latitude = gbfgetdbl(fin);
+ wpt->longitude = gbfgetdbl(fin);
+ wpt->altitude = gbfgetdbl(fin);
+
+ if (datum < 0) {
+ fatal(MYNAME ": Invalid datum %d found", datum);
+ }
+ convert_datum(wpt, datum);
+
+ track_add_wpt(track, wpt);
+
+ if (version == 8) {
+ gbfseek(fin, 34, SEEK_CUR); /* skip unknown 34 bytes */
+ }
+ }
+
+ if (version == 8) {
+
+ int i = gbfgetint16(fin);
+ i = gbfgetc(fin);
+ if (i == 0) {
+ return;
+ }
+
+ gbfungetc(i, fin);
+ datum = read_datum(fin);
+
+ (void) gbfgetint16(fin);
+ (void) gbfgetint32(fin);
+
+ gbfread(buf, 1, 9, fin);
+ if (strncmp(buf, "CWayPoint", 9) != 0) {
+ warning(MYNAME ": Unsupported waypoint structure!\n");
+ return;
+ }
+
+ while (! gbfeof(fin)) {
+ i = gbfgetc(fin);
+ if (i == 0) {
+ break;
+ }
+
+ gbfungetc(i, fin);
+ datum = read_datum(fin);
+
+ auto* wpt = new Waypoint;
+
+ wpt->latitude = gbfgetdbl(fin);
+ wpt->longitude = gbfgetdbl(fin);
+ wpt->altitude = gbfgetdbl(fin);
+
+ gbfseek(fin, 36, SEEK_CUR); /* skip unknown 36 bytes */
+
+ wpt->notes = read_str(fin);
+ wpt->description = read_str(fin);
+ (void) gbfgetint16(fin);
+
+ waypt_add(wpt);
+ }
+ return;
+ }
+
+ int32_t wcount = gbfgetint32(fin);
+ if (wcount == 0) {
+ return;
+ }
+
+ datum = read_datum(fin);
+
+ while (wcount > 0) {
+ wcount--;
+
+ auto* wpt = new Waypoint;
+
+ wpt->latitude = gbfgetdbl(fin);
+ wpt->longitude = gbfgetdbl(fin);
+ wpt->altitude = gbfgetdbl(fin);
+
+ convert_datum(wpt, datum);
+
+ int32_t namect = gbfgetint32(fin);
+
+ // variants of shortname
+
+ for (int32_t i = 0; i < namect; i++) {
+ auto name = read_str(fin);
+ if (!name.isEmpty()) {
+ switch (i) {
+ case 0:
+ wpt->description = name;
+ break;
+ case 1:
+ wpt->shortname = name;
+ break;
+ }
+ }
+ }
+
+ waypt_add(wpt);
+ }
+}
+
+
+#if !ZLIB_INHIBITED
+
+static int
+inflate_buff(const char* buff, const size_t size, char** out_buff)
+{
+ z_stream strm;
+ char out[DEFLATE_BUFF_SIZE];
+ char* cout = nullptr;
+ uint32_t bytes = 0;
+
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+
+ int res = inflateInit(&strm);
+ if (res != Z_OK) {
+ return res;
+ }
+
+ strm.avail_in = size;
+ strm.next_in = (Bytef*)buff;
+
+ do {
+ strm.avail_out = DEFLATE_BUFF_SIZE;
+ strm.next_out = (Bytef*)out;
+ res = inflate(&strm, Z_NO_FLUSH);
+
+ switch (res) {
+ case Z_NEED_DICT:
+ res = Z_DATA_ERROR;
+ [[fallthrough]];
+ case Z_DATA_ERROR:
+ case Z_MEM_ERROR:
+ (void)inflateEnd(&strm);
+ return res;
+ }
+ uint32_t have = DEFLATE_BUFF_SIZE - strm.avail_out;
+ if (have > 0) {
+ cout = (char*) xrealloc(cout, bytes + have);
+ memcpy(cout+bytes, out, have);
+ bytes+=have;
+ }
+ } while (strm.avail_out == 0);
+
+ *out_buff = cout;
+ return res;
+}
+
+
+static void
+read_CXMLSafe()
+{
+ char* xmlstr = nullptr;
+
+ xmlbin = nullptr;
+ xmlbinsize = 0;
+
+ xml_init(fin->name, tlog3a_xgcb_map, nullptr);
+ xml_read();
+ xml_deinit();
+
+ if (xmlbin != nullptr) {
+ inflate_buff(xmlbin, xmlbinsize, &xmlstr);
+ xfree(xmlbin);
+
+ xml_init(nullptr, tlog3b_xgcb_map, nullptr);
+ xml_readstring(xmlstr);
+ xml_deinit();
+
+ xfree(xmlstr);
+ }
+}
+
+#endif
+
+static void
+read_XML()
+{
+ xml_init(fin->name, tlog3b_xgcb_map, nullptr);
+ xml_read();
+ xml_deinit();
+}
+
+/*******************************************************************************
+* %%% global callbacks called by gpsbabel main process %%% *
+*******************************************************************************/
+
+static void
+dmtlog_rd_init(const QString& fname)
+{
+ fin = gbfopen_le(fname, "rb", MYNAME);
+
+ xmlbin = nullptr;
+ xmltrk = nullptr;
+ xmlwpt = nullptr;
+ xmlgrid = QString();
+}
+
+static void
+dmtlog_rd_deinit()
+{
+ gbfclose(fin);
+}
+
+static void
+dmtlog_read()
+{
+ switch (gbfgetuint32(fin)) {
+
+ case 0x4FFFF:
+ read_CTrackFile(4);
+ break;
+
+ case 0x8FFFF:
+ read_CTrackFile(8);
+ break;
+
+ case 0x4d58433c:
+#if !ZLIB_INHIBITED
+ read_CXMLSafe();
+#else
+ fatal(MYNAME ": Zlib was not included in this build.\n");
+#endif
+ break;
+ case 0x7254433c:
+ read_XML();
+ break;
+
+ default:
+ fatal(MYNAME ": Unknown or unsupported file type.\n");
+ }
+}
+
+static void
+dmtlog_wr_init(const QString& fname)
+{
+ fout = gbfopen_le(fname, "wb", MYNAME);
+}
+
+static void
+dmtlog_wr_deinit()
+{
+ gbfclose(fout);
+}
+
+static void
+write_header(const route_head* trk)
+{
+ const char ZERO = '\0';
+
+ header_written = 1;
+
+ int count = 0;
+ if (trk != nullptr) {
+ count = trk->rte_waypt_ct();
+ }
+ if (!trk || trk->rte_name.isEmpty()) {
+ write_str("Name", fout);
+ } else {
+ write_str(trk->rte_name, fout);
+ }
+
+ // This fails for internationalization, but as this text is in the
+ // file itself, it shouldn't be localized.
+ QString cout = QString::number(count) + " trackpoints and " +
+ QString::number(waypt_count()) + " waypoints";
+ write_str(cout, fout);
+
+ for (int i = 3; i <= 8; i++) {
+ gbfputc(ZERO, fout);
+ }
+ write_str("GPSBabel", fout);
+ gbfputint32(count, fout);
+ if (count > 0) {
+ write_str("WGS84", fout);
+ write_str("WGS84", fout);
+ }
+}
+
+static void
+track_hdr_cb(const route_head* trk)
+{
+
+ this_index++;
+ if (this_index != track_index) {
+ return;
+ }
+ write_header(trk);
+}
+
+static void
+track_wpt_cb(const Waypoint* wpt)
+{
+ if (this_index != track_index) {
+ return;
+ }
+
+ gbfputdbl(wpt->latitude, fout);
+ gbfputdbl(wpt->longitude, fout);
+ gbfputdbl(wpt->altitude != unknown_alt ? wpt->altitude : 0, fout);
+}
+
+static void
+wpt_cb(const Waypoint* wpt)
+{
+ gbfputdbl(wpt->latitude, fout);
+ gbfputdbl(wpt->longitude, fout);
+ gbfputdbl(wpt->altitude != unknown_alt ? wpt->altitude : 0, fout);
+
+ int names = 1;
+ if (!wpt->description.isEmpty()) {
+ names = 2;
+ }
+ gbfputint32(names, fout);
+ if (names > 1) {
+ write_str(wpt->description, fout);
+ }
+ write_str(wpt->shortname.isEmpty() ? "Name" : wpt->shortname, fout);
+}
+
+static void
+dmtlog_write()
+{
+ track_index = atoi(opt_index);
+ /* ... validate index */
+
+ gbfputint32(0x4FFFF, fout);
+ gbfputuint16(0x0A, fout);
+ gbfputs("CTrackFile", fout);
+ gbfputint32(4, fout);
+ gbfputint32(1, fout);
+ gbfputint32(0x100001, fout);
+ gbfputuint32((uint32_t)gpsbabel_time, fout);
+
+ header_written = 0;
+ this_index = 0;
+ track_disp_all(track_hdr_cb, nullptr, track_wpt_cb);
+ if (!header_written) {
+ write_header(nullptr);
+ }
+ gbfputint32(waypt_count(), fout);
+ if (waypt_count() > 0) {
+ write_str("WGS84", fout);
+ write_str("WGS84", fout);
+ waypt_disp_all(wpt_cb);
+ }
+}
+
+/**************************************************************************/
+
+ff_vecs_t dmtlog_vecs = {
+ ff_type_file,
+ {
+ (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
+ (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
+ ff_cap_none /* routes */
+ },
+ dmtlog_rd_init,
+ dmtlog_wr_init,
+ dmtlog_rd_deinit,
+ dmtlog_wr_deinit,
+ dmtlog_read,
+ dmtlog_write,
+ nullptr,
+ &dmtlog_args,
+ CET_CHARSET_ASCII, 0
+ , NULL_POS_OPS
+};
+
+/**************************************************************************/
--- /dev/null
+/*
+ Copyright (C) 2008 Andreas Grimme, andreas.grimme(at)gmx.net
+ Copyright (C) 2005 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+/*
+ This module will download track data from a
+
+ XAiOX iTrackU BLUETOOTH GPS-RECEIVER SiRF III
+ http://www.xaiox.com/itracku_sirf3.htm
+
+ Example usage::
+
+ # Read from USB port, output trackpoints & waypoints in GPX format
+ ./gpsbabel -i itracku -f com14 -o gpx -F out.gpx
+
+ */
+#include <cmath> // for lround, round, floor
+#include <cstdarg> // for va_end, va_list, va_start
+#include <cstdio> // for fprintf, stderr, SEEK_END, fflush, sscanf, vfprintf
+#include <cstdint>
+#include <cstring> // for memcpy, strcmp, strlen, strncmp
+#include <ctime> // for gmtime
+
+#include <QByteArray> // for QByteArray
+#include <QDate> // for QDate
+#include <QDateTime> // for QDateTime
+#include <QString> // for QString
+#include <QTime> // for QTime
+#include <Qt> // for UTC
+#include <QtGlobal> // for qPrintable
+
+#include "defs.h"
+#include "gbser.h" // for gbser_read_line, gbser_write, gbser_deinit, gbser_flush, gbser_init, gbser_is_serial, gbser_read_wait, gbser_ERROR, gbser_OK
+#include "gbfile.h" // for gbfile, gbfclose, gbfopen, gbfseek, gbfread, gbfwrite, gbftell, gbsize_t
+#include "src/core/datetime.h" // for DateTime
+
+
+#define MYNAME "itracku"
+
+/* memory layout of the iTrackU data record */
+struct itracku_data_record {
+ uint8_t longitude[4];
+ uint8_t latitude[4];
+ uint8_t creation_time[4];
+ uint8_t altitude[2];
+ uint8_t speed;
+ uint8_t flag;
+};
+
+static int itracku_is_valid_data_record(itracku_data_record* d);
+static void to_itracku_data_record(const Waypoint* wp, itracku_data_record* d);
+static Waypoint* to_waypoint(itracku_data_record* d);
+
+/* itracku file access */
+static void itracku_file_read_data_record(gbfile* fin, itracku_data_record* d);
+static uint32_t itracku_file_read_last_time(gbfile* fin);
+static void itracku_file_read_waypts(gbfile* fin, void (*waypt_add)(Waypoint* wpt));
+static void itracku_file_write_waypt(gbfile* fout, const Waypoint* wpt);
+
+/* itracku device access */
+static const unsigned char read_update_data_command[] = { 0x60, 0xb5, 0, 0, 0, 0, 0 }; /* command string to start memory dump */
+static const int timeout = 1000; /* timeout for all read operations */
+static const char update_end_marker[] = "WP Update Over"; /* end marker for the memory dump */
+static const int update_end_marker_size = sizeof(update_end_marker);
+#if LATER
+static const int port_auto_detect_max_port = 32;
+/* Special port name for auto detect. If used, gpsbabel will try to detect the serial
+port with the itracku device automatically. */
+static const char port_auto_detect_filename[] = "auto:";
+#endif
+
+static int update_data_buffer_read_count = 0;
+static char update_data_buffer[1024];
+static char* update_data_buffer_read;
+static char* update_data_buffer_write;
+static char* update_data_buffer_end;
+
+static void itracku_device_dump_waypts(void* fd, void (*waypt_add)(Waypoint* wpt));
+static int itracku_device_update_data_init();
+static int itracku_device_update_data_read(void* buf, int len);
+static void itracku_device_write_string(const char* s);
+static const char* itracku_device_read_string();
+
+/* global variables */
+static void* fd_; /* serial fd */
+static gbfile* fin_; /* input file handle */
+static gbfile* fout_; /* output file handle */
+static gbfile* fbackup; /* backup file handle */
+static uint32_t backup_last_creation_time; /* time of last data record in backup file */
+static uint32_t new_waypoint_count; /* count of new waypoints */
+static char* port; /* serial port name */
+static char* backup_file_name; /* "backup" command option */
+static char* only_new; /* "new" command option */
+
+static void
+dbg(int l, const char* msg, ...)
+{
+ va_list ap;
+ va_start(ap, msg);
+ if (global_opts.debug_level >= l) {
+ fprintf(stderr, MYNAME ": ");
+ vfprintf(stderr,msg, ap);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
+ va_end(ap);
+}
+
+static void
+itracku_device_write_string(const char* s)
+{
+ int size = strlen(s) + 1;
+ dbg(1, "write to device: %s", s);
+ gbser_write(fd_, s, size);
+}
+
+static const char*
+itracku_device_read_string()
+{
+ const int size = 1024;
+ char* s = (char*) xmalloc(size);
+ gbser_read_line(fd_, s, size, 1000, 0, 0);
+ dbg(1, "read from device: %s", s);
+ return s;
+}
+
+static int
+itracku_device_update_data_init()
+{
+ update_data_buffer_read = update_data_buffer;
+ update_data_buffer_write = update_data_buffer;
+ update_data_buffer_end = update_data_buffer + sizeof(update_data_buffer);
+ update_data_buffer_read_count = 0;
+ dbg(1, "start memory dump");
+ return 0;
+}
+
+static int
+itracku_device_update_data_read(void* buf, int len)
+{
+ if (update_data_buffer_write - update_data_buffer_read >= len) {
+ memcpy(buf, update_data_buffer_read, len);
+ update_data_buffer_read += len;
+ return len;
+ }
+
+ if (update_data_buffer_read + update_end_marker_size > update_data_buffer_end) {
+ memcpy(update_data_buffer, update_data_buffer_read, update_data_buffer_write - update_data_buffer_read);
+ update_data_buffer_write = update_data_buffer + (update_data_buffer_write - update_data_buffer_read);
+ update_data_buffer_read = update_data_buffer;
+ }
+
+ int rc = gbser_read_wait(fd_, update_data_buffer_write, update_data_buffer_end - update_data_buffer_write, timeout);
+ if (rc == gbser_ERROR) {
+ return 0;
+ }
+
+ update_data_buffer_write += rc;
+ update_data_buffer_read_count += rc;
+ dbg(1, "%5d kbyte read", update_data_buffer_read_count / 1024);
+
+ if (0 == strncmp(update_end_marker, update_data_buffer_write - update_end_marker_size, update_end_marker_size - 1)) {
+ dbg(1, "end memory dump");
+ return 0;
+ }
+
+ return itracku_device_update_data_read(buf, len);
+}
+
+/*
+ Convert the degrees format of itracku to double.
+
+ itracku stores degrees in a
+ 32-bit unsigned integer. The lower
+ 6 digits in 10-base notation denote the
+ minutes multiplied by 10000, and digits
+ 7-9 denote the degrees.
+
+ To express a negative number 0x80000000 is added
+ to integer.
+
+ Example: the integer 49347687 is interpreted
+ as
+
+ ddmmmmmm
+ 49347687
+
+ d=49
+ m=34.7687
+
+ 49 degrees 34.7687 minutes
+*/
+// The argument is marked 'volatile' because of an issue in Apple's v1.5 clang.
+// Without this, the sign of 'x' mysteriously changes while in the function.
+// adding a printf inside branches not taken changes the behaviour. Very
+// mysterious, but not worth tracking down at this time. When xcode 4 comes
+// along (or anyone really cares about mega performance of this fairly obscure
+// target, we should revisit this.
+static double
+deg_min_to_deg(volatile uint32_t x)
+{
+ double sign;
+ // determine the sign
+ if (x > 0x80000000) {
+ sign = -1.0;
+ x -= 0x80000000;
+ } else {
+ sign = 1.0;
+ }
+
+ uint32_t sep = 1000000;
+
+ // extract degrees
+ uint32_t d = (unsigned int) x / (unsigned int) sep;
+ // extract (minutes * 10000)
+ uint32_t m10000 = x - d * sep;
+
+ // convert minutes and degrees to a double
+ return sign * ((double)d + ((double)m10000) / 600000.0);
+}
+
+/*
+ Convert degrees to the degrees format of itracku.
+*/
+static uint32_t
+deg_to_deg_min(double x)
+{
+ int32_t sign;
+
+ // determine sign
+ if (x >= 0) {
+ sign = 1;
+ } else {
+ sign = -1;
+ x = -x;
+ }
+
+ // integer degrees
+ double d = floor(x);
+
+ // fractional part
+ double f = x - d;
+
+ return
+ (uint32_t)d * 1000000 + // multiply integer degrees to shift it to the right digits.
+ (uint32_t)round((f * 600000.0)) + // multiply fractional part to convert to minutes and to to shift it to the right digits.
+ ((sign > 0) ? 0 : 0x80000000); // add 0x80000000 for negative degrees
+}
+
+/*
+ Convert the itracku time format to time_t.
+*/
+static QDateTime
+decode_itracku_time(uint32_t date)
+{
+ int seconds = date & 63;
+ int minutes = (date >> 6) & 63;
+ int hours = (date >> 12) & 31;
+ QTime qtime(hours, minutes, seconds);
+
+ int day = (date >> 17) & 31;
+ int month = ((date >> 22) & 15);
+ int year = ((date >> 26) & 63) + 2000;
+ QDate qdate(year, month, day);
+
+ return QDateTime(qdate, qtime, Qt::UTC);
+}
+
+/*
+ Convert time_t to the itracku time format.
+*/
+static uint32_t
+encode_itracku_time(time_t time)
+{
+ struct tm* t = gmtime(&time);
+ return
+ (t->tm_sec) +
+ (t->tm_min << 6) +
+ (t->tm_hour << 12) +
+ (t->tm_mday << 17) +
+ ((t->tm_mon + 1) << 22) +
+ ((t->tm_year - 100) << 26);
+}
+
+/*
+ Converts a itracku waypoint record to a gpsbabel waypoint.
+*/
+static Waypoint*
+to_waypoint(itracku_data_record* d)
+{
+ auto* wp = new Waypoint;
+ wp->longitude = deg_min_to_deg(le_read32(d->longitude));
+ wp->latitude = deg_min_to_deg(le_read32(d->latitude));
+ wp->SetCreationTime(decode_itracku_time(le_read32(d->creation_time)));
+ wp->speed = KNOTS_TO_MPS((float)d->speed);
+ wp->wpt_flags.speed = 1;
+ wp->altitude = le_read16(d->altitude);
+ return wp;
+}
+
+static void
+to_itracku_data_record(const Waypoint* wp, itracku_data_record* d)
+{
+ le_write32(d->longitude, deg_to_deg_min(wp->longitude));
+ le_write32(d->latitude, deg_to_deg_min(wp->latitude));
+ le_write32(d->creation_time, encode_itracku_time(wp->creation_time.toTime_t()));
+ d->speed = round(MPS_TO_KNOTS(wp->speed));
+ le_write16(d->altitude, wp->altitude);
+ d->flag = 0xff;
+}
+
+/*
+ Tries to initialize an itracku device attached to
+ serial port fd. fd must already be opened.
+
+ Returns gbser_OK if the initialization is successful, a
+ non-zero integer otherwise.
+*/
+static int
+init_device()
+{
+ int rc;
+ // verify that we have a MTK based logger...
+ dbg(1, "verifying device on port %s", port);
+
+ itracku_device_write_string("WP AP-Exit");
+ gbser_flush(fd_);
+ itracku_device_write_string("W'P Camera Detect");
+ const char* greeting = itracku_device_read_string();
+
+ if (0 == strcmp(greeting , "WP GPS+BT")) {
+ dbg(1, "device recognised on port %s", port);
+ rc = gbser_OK;
+ } else {
+ dbg(1, "device not recognised on port %s", port);
+ rc = gbser_ERROR;
+ }
+ xfree((void*)greeting);
+ return rc;
+}
+
+// Any arg in this list will appear in command line help and will be
+// populated for you.
+// Values for ARGTYPE_xxx can be found in defs.h and are used to
+// select the type of option.
+static
+QVector<arglist_t> itracku_args = {
+ { "backup", &backup_file_name, "Appends the input to a backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
+ { "new", &only_new, "Only waypoints that are not the backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
+// "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
+};
+
+/*******************************************************************************
+* %%% global callbacks called by gpsbabel main process %%% *
+*******************************************************************************/
+
+static void
+itracku_rd_init_common(const QString&)
+{
+ new_waypoint_count = 0;
+
+ if (backup_file_name != nullptr) {
+ fbackup = gbfopen(backup_file_name, "a+", MYNAME);
+ backup_last_creation_time = itracku_file_read_last_time(fbackup);
+ gbfseek(fbackup, 0, SEEK_END);
+ } else {
+ fbackup = nullptr;
+ backup_last_creation_time = 0;
+ }
+}
+
+static void
+itracku_rd_ser_init(const QString& fname)
+{
+#if LATER
+ if (0 == strcmp(qPrintable(fname), port_auto_detect_filename)) {
+ dbg(1, "auto detecting port for iTrackU device");
+ for (int i=1; !fd_ && i<port_auto_detect_max_port; ++i) {
+ xasprintf(&port, "com%d", i);
+ if (!gbser_is_serial(port)) {
+ break;
+ }
+ dbg(1, "trying port %s", port);
+ if ((fd_ = gbser_init(port)) == NULL) {
+ dbg(1, "port %s not available.", port);
+ continue;
+ }
+
+ if (gbser_OK == init_device()) {
+ break;
+ }
+
+ gbser_deinit(fd_);
+ fd_ = NULL;
+ xfree(port);
+ }
+ for (int i=0; !fd_ && i<port_auto_detect_max_port; ++i) {
+ xasprintf(&port, "/dev/ttyUSB%d", i);
+ if (!gbser_is_serial(port)) {
+ break;
+ }
+ dbg(1, "trying port %s", port);
+ if ((fd_ = gbser_init(port)) == NULL) {
+ dbg(1, "port %s not available.", port);
+ continue;
+ }
+
+ if (gbser_OK == init_device()) {
+ break;
+ }
+
+ gbser_deinit(fd_);
+ fd_ = NULL;
+ xfree(port);
+ }
+ if (fd_ == NULL) {
+ fatal(MYNAME ": could not find device");
+ }
+ } else
+#endif
+ {
+
+ if (gbser_is_serial(qPrintable(fname))) {
+ port = xstrdup(qPrintable(fname));
+
+ dbg(1, "opening port %s", qPrintable(fname));
+ if ((fd_ = gbser_init(port)) == nullptr) {
+ fatal(MYNAME ": can't initialise port \"%s\"", port);
+ }
+
+ if (gbser_OK != init_device()) {
+ fatal(MYNAME ": can't initialise device on port \"%s\"", port);
+ }
+ } else {
+ fatal(MYNAME ": \"%s\" is not a valid serial port", qPrintable(fname));
+ }
+ }
+
+ itracku_rd_init_common(fname);
+}
+
+static void
+itracku_rd_init(const QString& fname)
+{
+ fin_ = gbfopen(fname, "r", MYNAME);
+ itracku_rd_init_common(fname);
+}
+
+static void
+itracku_rd_deinit()
+{
+ dbg(1, "%d new waypoints", new_waypoint_count);
+ if (fd_) {
+ dbg(3, "closing port %s", port);
+ gbser_deinit(fd_);
+ fd_ = nullptr;
+ xfree(port);
+ port = nullptr;
+ }
+ if (fin_) {
+ gbfclose(fin_);
+ fin_ = nullptr;
+ }
+ if (fbackup) {
+ gbfclose(fbackup);
+ fbackup = nullptr;
+ }
+}
+
+/* Returns true if the waypoint is new, i.e. if it is not already in the
+backup file. */
+static int
+import_data_record(itracku_data_record* d)
+{
+ int result = 0;
+
+ if (!itracku_is_valid_data_record(d)) {
+ result = 0;
+ } else {
+ if (fbackup) {
+ if ((uint32_t)le_read32(d->creation_time) > backup_last_creation_time) {
+ backup_last_creation_time = le_read32(d->creation_time);
+ gbfwrite(d, sizeof(*d), 1, fbackup);
+ result = -1;
+ } else {
+ result = (only_new == nullptr);
+ }
+ } else {
+ result = -1;
+ }
+ }
+ if (result) {
+ ++new_waypoint_count;
+ }
+ return result;
+}
+
+static int
+itracku_is_valid_data_record(itracku_data_record* d)
+{
+ return !(le_read32(d->longitude) == -1);
+}
+
+static void
+itracku_device_dump_waypts(void* fd, void (*waypt_add)(Waypoint*))
+{
+ itracku_data_record d;
+
+ dbg(1, "reading memory");
+ gbser_write(fd, read_update_data_command, sizeof(read_update_data_command));
+
+ itracku_device_update_data_init();
+
+ while (itracku_device_update_data_read(&d, sizeof(d))) {
+ if (itracku_is_valid_data_record(&d)) {
+ if (import_data_record(&d)) {
+ waypt_add(to_waypoint(&d));
+ }
+ }
+ }
+}
+
+static void
+itracku_file_read_data_record(gbfile* fin, itracku_data_record* d)
+{
+ gbfread(d, sizeof(*d), 1, fin);
+}
+
+static uint32_t
+itracku_file_read_last_time(gbfile* fin)
+{
+ itracku_data_record d;
+ gbsize_t s = sizeof(itracku_data_record);
+ gbfseek(fin, 0, SEEK_END);
+ if (gbftell(fin) < s) {
+ return 0;
+ }
+ gbfseek(fin, -(int)s, SEEK_END);
+ itracku_file_read_data_record(fin, &d);
+ return (uint32_t) le_read32(d.creation_time);
+}
+
+static void
+itracku_file_read_waypts(gbfile* fin, void (*waypt_add)(Waypoint*))
+{
+ itracku_data_record d;
+
+ while (gbfread(&d, sizeof(d), 1, fin)) {
+ if (le_read32(d.longitude) == -1) {
+ continue;
+ }
+ if (import_data_record(&d)) {
+ waypt_add(to_waypoint(&d));
+ }
+ }
+}
+
+static void
+itracku_file_write_waypt(gbfile* fout, const Waypoint* wpt)
+{
+ itracku_data_record d;
+ to_itracku_data_record(wpt, &d);
+ gbfwrite(&d, sizeof(d), 1, fout);
+}
+
+static void
+itracku_waypt_input(void (*waypt_add)(Waypoint*))
+{
+ if (fd_) {
+ itracku_device_dump_waypts(fd_, waypt_add);
+ } else {
+ itracku_file_read_waypts(fin_, waypt_add);
+ }
+}
+
+static void
+itracku_read_waypt()
+{
+ itracku_waypt_input(&waypt_add);
+}
+
+static route_head* itracku_read_trk_track;
+
+static void
+itracku_read_trk_waypt_add(Waypoint* wpt)
+{
+ track_add_wpt(itracku_read_trk_track, wpt);
+}
+
+static void
+itracku_read_trk()
+{
+ itracku_read_trk_track = new route_head;
+ track_add_head(itracku_read_trk_track);
+ itracku_waypt_input(&itracku_read_trk_waypt_add);
+}
+
+static void
+itracku_read()
+{
+ switch (global_opts.objective) {
+ case wptdata:
+ case unknown_gpsdata:
+ itracku_read_waypt();
+ break;
+ case trkdata:
+ itracku_read_trk();
+ break;
+ case rtedata:
+ fatal(MYNAME ": reading routes is not supported.\n");
+ break;
+ case posndata:
+ break;
+ }
+}
+
+static void
+itracku_wr_init(const QString& fname)
+{
+ fout_ = gbfopen(fname, "w", MYNAME);
+}
+
+static void
+itracku_wr_deinit()
+{
+ gbfclose(fout_);
+}
+
+static void
+itracku_output_waypoint(const Waypoint* wp)
+{
+ itracku_file_write_waypt(fout_, wp);
+}
+
+static void
+itracku_write()
+{
+ waypt_disp_all(itracku_output_waypoint);
+}
+
+static void
+itracku_rt_init(const QString& fname)
+{
+ itracku_rd_ser_init(fname);
+ itracku_device_write_string("WP AP-Exit");
+}
+
+static void
+nmea_set_waypoint_time(Waypoint* wpt, struct tm* time, double fsec)
+{
+ if (time->tm_year == 0) {
+ wpt->SetCreationTime(((((time_t)time->tm_hour * 60) + time->tm_min) * 60) + time->tm_sec, lround(1000.0 * fsec));
+ if (wpt->wpt_flags.fmt_use == 0) {
+ wpt->wpt_flags.fmt_use = 1;
+ }
+ } else {
+ wpt->SetCreationTime(mkgmtime(time), lround(1000.0 * fsec));
+ if (wpt->wpt_flags.fmt_use != 0) {
+ wpt->wpt_flags.fmt_use = 0;
+ }
+ }
+}
+
+static Waypoint*
+gprmc_parse(char* ibuf)
+{
+ double latdeg, lngdeg;
+ char lngdir, latdir;
+ double hms;
+ char fix;
+ unsigned int dmy;
+ double speed,course;
+ struct tm tm;
+
+ int rc = sscanf(ibuf,"$GPRMC,%lf,%c,%lf,%c,%lf,%c,%lf,%lf,%u",
+ &hms, &fix, &latdeg, &latdir,
+ &lngdeg, &lngdir,
+ &speed, &course, &dmy);
+
+ if (rc == 0) {
+ return nullptr;
+ }
+
+ double fsec = hms - (int)hms;
+
+ tm.tm_sec = (long) hms % 100;
+ hms = hms / 100;
+ tm.tm_min = (long) hms % 100;
+ hms = hms / 100;
+ tm.tm_hour = (long) hms % 100;
+
+ tm.tm_year = dmy % 100 + 100;
+ dmy = dmy / 100;
+ tm.tm_mon = dmy % 100 - 1;
+ dmy = dmy / 100;
+ tm.tm_mday = dmy;
+
+ auto* waypt = new Waypoint;
+
+ WAYPT_SET(waypt, speed, KNOTS_TO_MPS(speed));
+
+ WAYPT_SET(waypt, course, course);
+
+ nmea_set_waypoint_time(waypt, &tm, fsec);
+
+ if (latdir == 'S') {
+ latdeg = -latdeg;
+ }
+ waypt->latitude = ddmm2degrees(latdeg);
+
+ if (lngdir == 'W') {
+ lngdeg = -lngdeg;
+ }
+ waypt->longitude = ddmm2degrees(lngdeg);
+
+ return waypt;
+}
+
+/*
+ TODO: this function should rather call code from
+ nmea.c instead of using a local copy of
+ gprmc_parse
+
+ andreas.grimme@gmx.net
+*/
+static Waypoint*
+itracku_rt_position(posn_status*)
+{
+ char line[1024];
+ while (true) {
+ gbser_read_line(fd_, line, sizeof(line), 5000, 13, 10);
+ dbg(1, line);
+ Waypoint* wpt = gprmc_parse(line);
+ if (wpt) {
+ return wpt;
+ }
+ }
+}
+
+static void
+itracku_rt_deinit()
+{
+ itracku_rd_deinit();
+}
+
+/**************************************************************************/
+
+
+ff_vecs_t itracku_vecs = {
+ ff_type_serial,
+ {
+ ff_cap_read /* waypoints */,
+ ff_cap_read /* tracks */,
+ ff_cap_none /* routes */
+ },
+ itracku_rd_ser_init,
+ nullptr,
+ itracku_rd_deinit,
+ nullptr,
+ itracku_read,
+ nullptr,
+ nullptr,
+ &itracku_args,
+ CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
+ /* not fixed, can be changed through command line parameter */
+ { itracku_rt_init, itracku_rt_position, itracku_rt_deinit, nullptr, nullptr, nullptr }
+};
+
+ff_vecs_t itracku_fvecs = {
+ ff_type_file,
+ {
+ (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
+ (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
+ ff_cap_none /* routes */
+ },
+ itracku_rd_init,
+ itracku_wr_init,
+ itracku_rd_deinit,
+ itracku_wr_deinit,
+ itracku_read,
+ itracku_write,
+ nullptr,
+ &itracku_args,
+ CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
+ /* not fixed, can be changed through command line parameter */
+ { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
+};
+
+
+/**************************************************************************/
--- /dev/null
+/*
+
+ Support for Navitel binary tracks (.bin),
+ copyright (C) 2008 Olaf.Klein@gpsbabel.org.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+#include "defs.h"
+#include "gbfile.h"
+#include "jeeps/gpsmath.h"
+
+#define MYNAME "navitel"
+
+static gbfile* fin, *fout;
+static char new_track;
+static int trkpts;
+
+/*******************************************************************************
+* %%% global callbacks called by gpsbabel main process %%% *
+*******************************************************************************/
+
+static void
+navitel_rd_init(const QString& fname)
+{
+ fin = gbfopen(fname, "rb", MYNAME);
+}
+
+static void
+navitel_rd_deinit()
+{
+ gbfclose(fin);
+}
+
+static void
+navitel_read_track()
+{
+ route_head* trk = nullptr;
+
+ int points = gbfgetint32(fin);
+ (void) gbfgetint32(fin); /* unknown */
+
+ for (int i = 0; i < points; i++) {
+ int lon = gbfgetint32(fin);
+ int lat = gbfgetint32(fin);
+
+ auto* wpt = new Waypoint;
+ wpt->latitude = GPS_Math_Semi_To_Deg(lat & 0x7FFFFFFF);
+ wpt->longitude = GPS_Math_Semi_To_Deg(lon);
+
+ if ((lat >> 31) || (trk == nullptr)) {
+ trk = new route_head;
+ track_add_head(trk);
+ }
+ track_add_wpt(trk, wpt);
+ }
+}
+
+static void
+navitel_wr_init(const QString& fname)
+{
+ fout = gbfopen(fname, "wb", MYNAME);
+}
+
+static void
+navitel_wr_deinit()
+{
+ gbfclose(fout);
+}
+
+static void
+navitel_enum_trkpts(const Waypoint*)
+{
+ trkpts++;
+}
+
+static void
+navitel_disp_trk_head(const route_head*)
+{
+ new_track = 1;
+}
+
+static void
+navitel_disp_trkpts(const Waypoint* wpt)
+{
+ int lat = GPS_Math_Deg_To_Semi(wpt->latitude);
+ int lon = GPS_Math_Deg_To_Semi(wpt->longitude);
+
+ if (new_track) {
+ lat |= (1 << 31);
+ new_track = 0;
+ }
+
+ gbfputint32(lon, fout);
+ gbfputint32(lat, fout);
+}
+
+static void
+navitel_write_track()
+{
+ trkpts = 0;
+ track_disp_all(nullptr, nullptr, navitel_enum_trkpts);
+ if (trkpts > 10000) {
+ trkpts = 10000;
+ warning(MYNAME ": Can store only 10000 points per file!\n");
+ }
+
+ gbfputint32(trkpts, fout);
+ gbfputint32(1, fout); /* ? */
+ track_disp_all(navitel_disp_trk_head, nullptr, navitel_disp_trkpts);
+}
+
+/**************************************************************************/
+
+ff_vecs_t navitel_trk_vecs = {
+ ff_type_file,
+ {
+ ff_cap_none /* waypoints */,
+ (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
+ ff_cap_none /* routes */
+ },
+ navitel_rd_init,
+ navitel_wr_init,
+ navitel_rd_deinit,
+ navitel_wr_deinit,
+ navitel_read_track,
+ navitel_write_track,
+ nullptr,
+ nullptr,
+ CET_CHARSET_UTF8, 1 /* Nothing to convert */
+ , NULL_POS_OPS
+};
+
+/**************************************************************************/
--- /dev/null
+/*
+
+ Support for Raymarine Waypoint File (.rwf).
+
+ Copyright (C) 2006,2007 Olaf Klein, o.b.klein@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+/*
+ Known format limits:
+
+ Waypoint name: max. 16 characters
+ Route name: max. 16 characters
+ Routes: max. 50 waypoints per route
+ ???: the character set may be only a subset of std. ASCII
+
+ History:
+
+ 2006/10/30: Initial release (not yet in GPSBabel source tree)
+ 2006/11/08:
+ 2007/03/17: Remove GUIDs from writer (not really valid)
+ Fix "PredictedTwa" output
+ Initialize location with "My Waypoints"
+ Change default value for RcCount and RelSet (now 0)
+ 2007/04/18: Limit route names also to 16 characters
+ Bug-fix - add missing comma (write_route_wpt_cb/items)
+ Change line feeds to fixed CRLF
+ Sort waypoints by name (not really needed, but nice)
+ Add some MapSource icon names to icon mappings
+ Remove unused id from icon table
+*/
+
+#include "defs.h"
+#include "csv_util.h"
+#include "inifile.h"
+
+#include <QString>
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
+
+static inifile_t* fin;
+static gbfile* fout;
+static Waypoint** waypt_table;
+static short_handle hshort_wpt, hshort_rte;
+static int waypt_table_sz, waypt_table_ct;
+static int rte_index, rte_wpt_index;
+static char* opt_location;
+
+#define MYNAME "raymarine"
+
+static
+QVector<arglist_t> raymarine_args = {
+ { "location", &opt_location, "Default location", "My Waypoints", ARGTYPE_STRING, ARG_NOMINMAX , nullptr},
+};
+
+/* from csv_util.c: convert excel time (days since 1900) to time_t and back again */
+
+#define EXCEL_TO_TIMET(a) ((a - 25569.0) * 86400.0)
+#define TIMET_TO_EXCEL(a) ((a / 86400.0) + 25569.0)
+
+#define LINE_FEED "\r\n"
+
+/* Bitmaps */
+
+struct raymarine_symbol_mapping_t {
+ const char* name;
+ const char* mps_name;
+};
+
+static const raymarine_symbol_mapping_t raymarine_symbols[] = {
+ { /* 0 */ "Unknown Symbol 0", nullptr },
+ { /* 1 */ "Unknown Symbol 1", nullptr },
+ { /* 2 */ "Unknown Symbol 2", nullptr },
+ { /* 3 */ "Red Square", nullptr },
+ { /* 4 */ "Big Fish", nullptr },
+ { /* 5 */ "Anchor", nullptr },
+ { /* 6 */ "Smiley", "Contact, Smiley" },
+ { /* 7 */ "Sad", nullptr },
+ { /* 8 */ "Red Button", "Navaid, Red" },
+ { /* 9 */ "Sailfish", nullptr },
+ { /* 10 */ "Danger", "Skull and Crossbones" },
+ { /* 11 */ "Attention", nullptr },
+ { /* 12 */ "Black Square", nullptr },
+ { /* 13 */ "Intl. Dive Flag", "Diver Down Flag 2" },
+ { /* 14 */ "Vessel", "Marina" },
+ { /* 15 */ "Lobster", nullptr },
+ { /* 16 */ "Buoy", "Buoy, White" },
+ { /* 17 */ "Exclamation", nullptr },
+ { /* 18 */ "Red X", nullptr },
+ { /* 19 */ "Check Mark", nullptr },
+ { /* 20 */ "Black Plus", nullptr },
+ { /* 21 */ "Black Cross", nullptr },
+ { /* 22 */ "MOB", nullptr },
+ { /* 23 */ "Billfish", nullptr },
+ { /* 24 */ "Bottom Mark", nullptr },
+ { /* 25 */ "Circle", "Circle, Red" },
+ { /* 26 */ "Diamond", "Block, Red" },
+ { /* 27 */ "Diamond Quarters", "Diamond, Red" },
+ { /* 28 */ "U.S. Dive Flag", "Diver Down Flag 1" },
+ { /* 29 */ "Dolphin", nullptr },
+ { /* 30 */ "Few Fish", nullptr },
+ { /* 31 */ "Multiple Fish", nullptr },
+ { /* 32 */ "Many Fish", nullptr },
+ { /* 33 */ "Single Fish", nullptr },
+ { /* 34 */ "Small Fish", nullptr },
+ { /* 35 */ "Marker", nullptr },
+ { /* 36 */ "Cocktails", "Bar" },
+ { /* 37 */ "Red Box Marker", nullptr },
+ { /* 38 */ "Reef", nullptr },
+ { /* 39 */ "Rocks", nullptr },
+ { /* 40 */ "Fish School", nullptr },
+ { /* 41 */ "Seaweed", "Weed Bed" },
+ { /* 42 */ "Shark", nullptr },
+ { /* 43 */ "Sportfisher", nullptr },
+ { /* 44 */ "Swimmer", "Swimming Area" },
+ { /* 45 */ "Top Mark", nullptr },
+ { /* 46 */ "Trawler", nullptr },
+ { /* 47 */ "Tree", nullptr },
+ { /* 48 */ "Triangle", "Triangle, Red" },
+ { /* 49 */ "Wreck", "Shipwreck" }
+};
+
+#define RAYMARINE_SYMBOL_CT sizeof(raymarine_symbols) / sizeof(raymarine_symbol_mapping_t)
+#define RAYMARINE_STD_SYMBOL 3
+
+static int
+find_symbol_num(const QString& descr)
+{
+ if (!descr.isNull()) {
+ const raymarine_symbol_mapping_t* a = &raymarine_symbols[0];
+
+ for (unsigned int i = 0; i < RAYMARINE_SYMBOL_CT; i++, a++) {
+ if (descr.compare(a->name, Qt::CaseInsensitive) == 0) {
+ return i;
+ }
+ if (a->mps_name && (descr.compare(a->mps_name, Qt::CaseInsensitive) == 0)) {
+ return i;
+ }
+ }
+ }
+
+ return RAYMARINE_STD_SYMBOL;
+}
+
+/* ============================================= */
+/* %%% R A Y M A R I N E R E A D E R %%% */
+/* ============================================= */
+
+static void
+raymarine_rd_init(const QString& fname)
+{
+ fin = inifile_init(fname, MYNAME);
+}
+
+static void
+raymarine_rd_done()
+{
+ inifile_done(fin);
+}
+
+static void
+raymarine_read()
+{
+ /* Read all waypoints */
+
+ for (unsigned int ix = 0; ix < 0x3FFF; ix++) {
+ char sect[10];
+ QString str, name, lat, lon;
+
+ /* built section identifier */
+ snprintf(sect, sizeof(sect), "Wp%u", ix);
+
+ /* try to read our most expected values */
+ name = inifile_readstr(fin, sect, "Name");
+ if (name.isNull()) {
+ break;
+ }
+ lat = inifile_readstr(fin, sect, "Lat");
+ if (lat.isNull()) {
+ break;
+ }
+ lon = inifile_readstr(fin, sect, "Long");
+ if (lon.isNull()) {
+ break;
+ }
+
+ auto* wpt = new Waypoint;
+ wpt->shortname = name;
+ wpt->latitude = lat.toDouble();
+ wpt->longitude = lon.toDouble();
+ waypt_add(wpt);
+
+ /* try to read optional values */
+ str = inifile_readstr(fin, sect, "Notes");
+ if (!str.isEmpty()) {
+ wpt->notes = str;
+ }
+ str = inifile_readstr(fin, sect, "Time");
+ if (!str.isEmpty()) {
+ wpt->SetCreationTime(EXCEL_TO_TIMET(str.toDouble()));
+ }
+ str = inifile_readstr(fin, sect, "Bmp");
+ if (!str.isEmpty()) {
+ unsigned int symbol = str.toInt();
+
+ if ((symbol < 3) || (symbol >= RAYMARINE_SYMBOL_CT)) {
+ symbol = RAYMARINE_STD_SYMBOL;
+ }
+ wpt->icon_descr = raymarine_symbols[symbol].name;
+ }
+ }
+
+ /* Read all routes */
+
+ for (unsigned int rx = 0; rx < 0x3FFF; rx++) {
+ char sect[10];
+ QString name;
+
+ snprintf(sect, sizeof(sect), "Rt%u", rx);
+ name = inifile_readstr(fin, sect, "Name");
+ if (name.isNull()) {
+ break;
+ }
+
+ auto* rte = new route_head;
+ rte->rte_name = name;
+ route_add_head(rte);
+
+ for (int wx = 0; wx < 0x3FFF; wx++) {
+ char buff[32];
+
+ snprintf(buff, sizeof(buff), "Mk%d", wx);
+ QString str = inifile_readstr(fin, sect, buff);
+ if (str.isEmpty()) {
+ break;
+ }
+
+ Waypoint* wpt = find_waypt_by_name(str);
+ if (wpt == nullptr)
+ fatal(MYNAME ": No associated waypoint for route point %s (Route %s)!\n",
+ qPrintable(str), qPrintable(rte->rte_name));
+
+ route_add_wpt(rte, new Waypoint(*wpt));
+ }
+ }
+}
+
+/* ============================================= */
+/* %%% R A Y M A R I N E W R I T E R %%% */
+/* ============================================= */
+
+/* make waypoint shortnames unique */
+
+static char
+same_points(const Waypoint* A, const Waypoint* B)
+{
+ return ( /* !!! We are case-sensitive !!! */
+ (A->shortname == B->shortname) &&
+ (A->latitude == B->latitude) &&
+ (A->longitude == B->longitude));
+}
+
+static void
+register_waypt(const Waypoint* ref, const char)
+{
+ auto* wpt = const_cast<Waypoint*>(ref);
+
+ for (int i = 0; i < waypt_table_ct; i++) {
+ Waypoint* cmp = waypt_table[i];
+
+ if (same_points(wpt, cmp)) {
+ wpt->extra_data = cmp->extra_data;
+ return;
+ }
+ }
+
+ if (waypt_table_ct >= waypt_table_sz) {
+ waypt_table_sz += 32;
+ if (waypt_table) {
+ waypt_table = (Waypoint**) xrealloc(waypt_table, waypt_table_sz * sizeof(wpt));
+ } else {
+ waypt_table = (Waypoint**) xmalloc(waypt_table_sz * sizeof(wpt));
+ }
+ }
+
+ wpt->extra_data = (void*)mkshort(hshort_wpt, CSTRc(wpt->shortname), false);
+
+ waypt_table[waypt_table_ct] = wpt;
+ waypt_table_ct++;
+}
+
+static void
+enum_waypt_cb(const Waypoint* wpt)
+{
+ register_waypt(wpt, 0);
+}
+
+static void
+enum_rtept_cb(const Waypoint* wpt)
+{
+ register_waypt(wpt, 1);
+}
+
+static int
+qsort_cb(const void* a, const void* b)
+{
+ const Waypoint* wa = *(Waypoint**)a;
+ const Waypoint* wb = *(Waypoint**)b;
+ return wa->shortname.compare(wb->shortname);
+}
+
+// TODO: this first arg is both a global and a param. That's weird.
+static void
+write_waypoint(gbfile* fileout, const Waypoint* wpt, const int waypt_no, const char* location)
+{
+ QString notes = wpt->notes;
+ if (notes == nullptr) {
+ notes = wpt->description;
+ if (notes == nullptr) {
+ notes = "";
+ }
+ }
+ notes = csv_stringclean(notes, LINE_FEED);
+ double time = wpt->creation_time.isValid() ? TIMET_TO_EXCEL(wpt->GetCreationTime().toTime_t()) : TIMET_TO_EXCEL(gpsbabel_time);
+ char* name = (char*)wpt->extra_data;
+
+ gbfprintf(fileout, "[Wp%d]" LINE_FEED
+ "Loc=%s" LINE_FEED
+ "Name=%s" LINE_FEED
+ "Lat=%.15f" LINE_FEED
+ "Long=%.15f" LINE_FEED,
+ waypt_no, location, name, wpt->latitude, wpt->longitude
+ );
+ gbfprintf(fileout, "Rng=%.15f" LINE_FEED
+ "Bear=%.15f" LINE_FEED
+ "Bmp=%d" LINE_FEED
+ "Fixed=1" LINE_FEED
+ "Locked=0" LINE_FEED
+ "Notes=%s" LINE_FEED,
+ 0.0, 0.0,
+ find_symbol_num(wpt->icon_descr),
+ CSTR(notes)
+ );
+ gbfprintf(fileout, "Rel=" LINE_FEED
+ "RelSet=0" LINE_FEED
+ "RcCount=0" LINE_FEED
+ "RcRadius=%.15f" LINE_FEED
+ "Show=1" LINE_FEED
+ "RcShow=0" LINE_FEED
+ "SeaTemp=%.15f" LINE_FEED
+ "Depth=%.15f" LINE_FEED
+ "Time=%.10f00000" LINE_FEED,
+ 0.0, -32678.0, 65535.0, time
+ );
+}
+
+static void
+write_route_head_cb(const route_head* rte)
+{
+ QString name = rte->rte_name;
+ if (name.isEmpty()) {
+ name=QString("Route%1").arg(rte_index);
+ }
+ name = mkshort(hshort_rte, name);
+ gbfprintf(fout, "[Rt%d]" LINE_FEED
+ "Name=%s" LINE_FEED
+ "Visible=1" LINE_FEED,
+ rte_index,
+ CSTR(name)
+ );
+ rte_index++;
+ rte_wpt_index = 0;
+}
+
+static void
+write_route_wpt_cb(const Waypoint* wpt)
+{
+ static const char* items[] = {
+ "Cog",
+ "Eta",
+ "Length",
+ "PredictedDrift",
+ "PredictedSet",
+ "PredictedSog",
+ "PredictedTime",
+ "PredictedTwa",
+ "PredictedTwd",
+ "PredictedTws"
+ };
+
+ gbfprintf(fout, "Mk%d=%s" LINE_FEED, rte_wpt_index, (char*)wpt->extra_data);
+ for (auto & item : items) {
+ gbfprintf(fout, "%s%d=%.15f" LINE_FEED, item, rte_wpt_index, 0.0);
+ }
+
+ rte_wpt_index++;
+}
+
+static void
+enum_route_hdr_cb(const route_head* rte)
+{
+ if (rte->rte_waypt_ct() > 50) {
+ fatal(MYNAME ": Routes with more than 50 points are not supported by Raymarine!");
+ }
+}
+
+static short_handle
+raymarine_new_short_handle()
+{
+ short_handle res = mkshort_new_handle();
+
+ setshort_length(res, 16);
+ setshort_badchars(res, ",");
+ setshort_mustupper(res, 0);
+ setshort_mustuniq(res, 1);
+ setshort_whitespace_ok(res, 1);
+ setshort_repeating_whitespace_ok(res, 1);
+
+ return res;
+}
+
+static void
+raymarine_wr_init(const QString& fname)
+{
+ fout = gbfopen(fname, "wb", MYNAME);
+
+ hshort_wpt = raymarine_new_short_handle();
+ hshort_rte = raymarine_new_short_handle();
+}
+
+static void
+raymarine_wr_done()
+{
+ mkshort_del_handle(&hshort_wpt);
+ mkshort_del_handle(&hshort_rte);
+
+ gbfclose(fout);
+}
+
+static void
+raymarine_write()
+{
+ int i;
+
+ waypt_table_sz = 0;
+ waypt_table_ct = 0;
+ waypt_table = nullptr;
+
+ /* enumerate all possible waypoints */
+ waypt_disp_all(enum_waypt_cb);
+ route_disp_all(enum_route_hdr_cb, nullptr, enum_rtept_cb);
+
+ if (waypt_table_ct == 0) {
+ return;
+ }
+
+ qsort(waypt_table, waypt_table_ct, sizeof(*waypt_table), qsort_cb);
+
+ /* write out waypoint summary */
+ for (i = 0; i < waypt_table_ct; i++) {
+ Waypoint* wpt = waypt_table[i];
+ write_waypoint(fout, wpt, i, opt_location);
+ }
+
+ /* write out all routes with their waypoints */
+ rte_index = 0;
+ route_disp_all(write_route_head_cb, nullptr, write_route_wpt_cb);
+
+ /* release local used data */
+ for (i = 0; i < waypt_table_ct; i++) {
+ Waypoint* wpt = waypt_table[i];
+ xfree(wpt->extra_data);
+ wpt->extra_data = nullptr;
+ }
+ xfree(waypt_table);
+}
+
+/* ================================================== */
+/* %%% M O D U L E R E G I S T R A T I O N %%% */
+/* ================================================== */
+
+ff_vecs_t raymarine_vecs = {
+ ff_type_file,
+ {
+ (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
+ ff_cap_none /* tracks */,
+ (ff_cap)(ff_cap_read | ff_cap_write) /* routes */,
+ },
+ raymarine_rd_init,
+ raymarine_wr_init,
+ raymarine_rd_done,
+ raymarine_wr_done,
+ raymarine_read,
+ raymarine_write,
+ nullptr,
+ &raymarine_args,
+ CET_CHARSET_ASCII, 0 /* should we force this to 1 ? */
+ , NULL_POS_OPS
+};
--- /dev/null
+# gpsbabel XCSV style file
+#
+# Format: MS S&T 2002/2003
+# Author: Alex Mottram
+# Date: 12/09/2002
+#
+#
+# As requested by Noel Shrum on the gpsbabel-code mailing list.
+# Name,Latitude,Longitude,Name 2,URL,Type
+# GCCBF,44.479133,-85.56515,High Rollaway by rjlint,http://www.geocaching.com/seek/cache_details.aspx?ID=3263,Traditional Cache
+# GC110D,44.6522,-85.492483,Brown Bridge Pond Peek-a-Boo Cache by Big Bird,http://www.geocaching.com/seek/cache_details.aspx?ID=4365,Traditional Cache
+# GC171C,44.70605,-85.62265,The Michigan Frog by RealDcoy & LRB,http://www.geocaching.com/seek/cache_details.aspx?ID=5916,Traditional Cache
+#
+
+DESCRIPTION Microsoft Streets and Trips 2002-2007
+EXTENSION txt
+
+
+#
+# FILE LAYOUT DEFINITIIONS:
+#
+FIELD_DELIMITER TAB
+RECORD_DELIMITER NEWLINE
+BADCHARS ,"
+
+PROLOGUE Name Latitude Longitude Description URL Type Container Diff Terr
+
+#
+# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
+# NOTE: MS S&T ONLY IMPORTS DATA, IT DOESN'T EXPORT THIS ANYWHERE SO WE CAN
+# HAVE OUR WAY WITH THE FORMATTING.
+#
+IFIELD SHORTNAME, "", "%s" # Name
+IFIELD LAT_DECIMAL, "", "%f" # Latitude
+IFIELD LON_DECIMAL, "", "%f" # Longitude
+IFIELD DESCRIPTION, "", "%s" # Name 2 (Big Description)
+IFIELD URL, "", "%s" # URL
+IFIELD GEOCACHE_TYPE, "", "%s" # Geocache Type
+IFIELD GEOCACHE_CONTAINER, "", "%s" # Geocache Type
+IFIELD GEOCACHE_DIFF, "", "%3.1f" # Geocache Type
+IFIELD GEOCACHE_TERR, "", "%3.1f" # Geocache Type
--- /dev/null
+/*
+ Support for XML based "TourExchangeFormat",
+ found in Map & Guide Motorrad-Tourenplaner 2005/06
+
+ Copyright (C) 2005 Olaf Klein, o.b.klein@gpsbabel.org
+
+ Based on kml.c, Keyhole "kml" format.
+ Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "tef_xml.h"
+
+#include <QLatin1String> // for QLatin1String
+#include <QString> // for QString, QStringView::toString
+#include <QXmlStreamAttribute> // for QXmlStreamAttribute
+#include <QXmlStreamAttributes> // for QXmlStreamAttributes
+#include <Qt> // for CaseInsensitive
+
+#include <type_traits> // for add_const<>::type
+
+#include "defs.h" // for Waypoint, fatal, wp_flags, route_add_head, route_add_wpt, route_head, waypt_add
+#include "xmlgeneric.h" // for xg_string, build_xg_tag_map, xml_deinit, xml_init, xml_read
+
+
+#define MYNAME "TourExchangeFormat"
+
+/*
+ * tef_start: check for comment "TourExchangeFormat"
+ */
+
+void
+TefXMLFormat::tef_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
+{
+ bool valid = false;
+
+ for (const auto& attr : *attrv) {
+ if (attr.name().compare(QLatin1String("Comment"), Qt::CaseInsensitive) == 0) {
+ if (attr.value().compare(QLatin1String("TourExchangeFormat"), Qt::CaseInsensitive) == 0) {
+ valid = true;
+ }
+ } else if (attr.name().compare(QLatin1String("Version"), Qt::CaseInsensitive) == 0) {
+ version = attr.value().toDouble();
+ }
+ }
+
+ if (!valid) {
+ fatal(MYNAME ": Error in source file.\n");
+ }
+}
+
+/*
+ * tef_header: "Name" > Route name, "Software" > Route descr.
+ */
+
+void
+TefXMLFormat::tef_header(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
+{
+ route = new route_head;
+ for (const auto& attr : *attrv) {
+ if (attr.name().compare(QLatin1String("Name"), Qt::CaseInsensitive) == 0) {
+ route->rte_name = attr.value().toString().trimmed();
+ } else if (attr.name().compare(QLatin1String("Software"), Qt::CaseInsensitive) == 0) {
+ route->rte_desc = attr.value().toString().trimmed();
+ }
+ }
+ route_add_head(route);
+}
+
+void
+TefXMLFormat::tef_list_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
+{
+ if (attrv->hasAttribute("ItemCount")) {
+ item_count = attrv->value("ItemCount").toUInt();
+ }
+}
+
+#if OMG
+
+/*
+ * TODO: this whole horrible mess is not covered at all in the test suite,
+ * so just stub it all out until someone cares. (TEF is rarely used from
+ * what we can tell.)
+ */
+
+
+/* in "TourExchangeFormat" the following can happen:
+ *
+ * SegDescription="L34\Wittlicher Strasse"
+ * PointDescription="Wittlicher Strasse ( "
+ *
+ * fix_notes tries to create a new PointDescription, which
+ * should be "Wittlicher Strasse (L34)" for the example above
+ */
+// FIXME: the calling convention here is screwy. notes is an input AND
+// output argument and may be modified.
+char*
+TefXMLFormat::fix_notes(const char* name, char* notes)
+{
+ const char* cleft, *cright, *cback;
+ char* ctmp;
+
+ if ((! name) || (! notes)) {
+ return notes;
+ }
+
+ /* do we have a BACKSLASH in shortname ? */
+ cback = strchr(name, '\\');
+ if ((! cback) || (cback == name)) {
+ return notes;
+ }
+
+ /* do we have left, but no right parenthesis in notes ? */
+ if (!(cleft = strchr(notes, '('))) {
+ return notes;
+ }
+ cright = strchr(notes, ')');
+ if (cright && (cright > cleft)) {
+ return notes;
+ }
+
+ /* now contruct the new name */
+ ctmp = lrtrim(xstrndup(notes, cleft - notes));
+ xfree(notes);
+ xasprintf(¬es, "%s (%*.*s)", ctmp, (int)(cback - name), (int)(cback - name), name);
+ xfree(ctmp);
+
+ return notes;
+}
+
+char*
+TefXMLFormat::Xfix_notes(const QString& name, const QString& notes)
+{
+
+ char* cname = xstrdup(name);
+ char* cnotes = xstrdup(notes);
+ char *r = fix_notes(cname, cnotes);
+ xfree(cname);
+// WTH? fix_notes() modifies the note string...and
+// may reallocate it.
+// xfree(cnotes);
+ return r;
+}
+#else
+QString
+TefXMLFormat::fix_notes(const QString& /*unused*/, const QString& notes){
+ return notes;
+}
+#endif
+
+void
+TefXMLFormat::waypoint_final()
+{
+ if (wpt_tmp == nullptr) {
+ return;
+ }
+
+ int via = wpt_tmp->wpt_flags.fmt_use;
+ wpt_tmp->wpt_flags.fmt_use = 0;
+
+ if (version < 2) { /* keep the old behaviour */
+ wpt_tmp->notes = wpt_tmp->description;
+ wpt_tmp->description = QString();
+ }
+
+ wpt_tmp->notes = fix_notes(wpt_tmp->shortname, wpt_tmp->notes);
+
+ if (via != 0) {
+ waypt_add(wpt_tmp);
+ }
+
+ if (route != nullptr) {
+ if ((via != 0) || (routevia == nullptr)) {
+ auto* wpt = new Waypoint(*wpt_tmp);
+ route_add_wpt(route, wpt);
+ }
+ }
+
+ if (via == 0) {
+ delete wpt_tmp;
+ }
+
+ wpt_tmp = nullptr;
+}
+
+void
+TefXMLFormat::tef_item_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/)
+{
+ waypoint_final();
+}
+
+void
+TefXMLFormat::tef_list_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/)
+{
+ waypoint_final();
+ if (waypoints != item_count)
+ fatal(MYNAME ": waypoint count differs to internal \"ItemCount\"! (%d to %d)\n",
+ waypoints, item_count);
+}
+
+void
+TefXMLFormat::tef_item_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
+{
+ waypoints++;
+
+ wpt_tmp = new Waypoint;
+ if ((waypoints == 1) || (waypoints == item_count)) {
+ wpt_tmp->wpt_flags.fmt_use ++;
+ }
+
+ for (const auto& attr : *attrv) {
+ QString attrstr = attr.value().toString();
+
+ if (attr.name().compare(QLatin1String("SegDescription"), Qt::CaseInsensitive) == 0) {
+ wpt_tmp->shortname = attrstr.trimmed();
+ } else if (attr.name().compare(QLatin1String("PointDescription"), Qt::CaseInsensitive) == 0) {
+ wpt_tmp->description = attrstr.trimmed();
+ } else if (attr.name().compare(QLatin1String("ViaStation"), Qt::CaseInsensitive) == 0 &&
+ attr.value().compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
+ wpt_tmp->wpt_flags.fmt_use = 1; /* only a flag */
+
+ /* new in TEF V2 */
+ } else if (attr.name().compare(QLatin1String("Instruction"), Qt::CaseInsensitive) == 0) {
+ wpt_tmp->description = attrstr.trimmed();
+ } else if (attr.name().compare(QLatin1String("Altitude"), Qt::CaseInsensitive) == 0) {
+ wpt_tmp->altitude = attrstr.toDouble();
+ } else if (attr.name().compare(QLatin1String("TimeStamp"), Qt::CaseInsensitive) == 0) {
+ /* nothing for the moment */
+ }
+ }
+}
+
+double
+TefXMLFormat::tef_read_comma_float(QStringView value)
+{
+ QString svalue = value.toString();
+
+ int cidx = svalue.indexOf(',');
+ if (cidx == -1) {
+ return svalue.toDouble();
+ }
+
+ QString fixed = svalue.replace(cidx, 1, '.');
+ return fixed.toDouble();
+}
+
+void
+TefXMLFormat::tef_point(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
+{
+ if (!wpt_tmp) {
+ return;
+ }
+
+ if (attrv->hasAttribute("y")) {
+ wpt_tmp->latitude = tef_read_comma_float(attrv->value("y"));
+ }
+
+ if (attrv->hasAttribute("x")) {
+ wpt_tmp->longitude = tef_read_comma_float(attrv->value("x"));
+ }
+}
+
+void
+TefXMLFormat::rd_init(const QString& fname)
+{
+ wpt_tmp = nullptr;
+ waypoints = 0;
+ item_count = -1;
+ version = 1.5;
+
+ xml_init(fname, build_xg_tag_map(this, tef_xml_map), nullptr, nullptr, nullptr, true);
+}
+
+void
+TefXMLFormat::read()
+{
+ xml_read();
+}
+
+void
+TefXMLFormat::rd_deinit()
+{
+ xml_deinit();
+}
--- /dev/null
+/*
+ Support for XML based "TourExchangeFormat",
+ found in Map & Guide Motorrad-Tourenplaner 2005/06
+
+ Copyright (C) 2005 Olaf Klein, o.b.klein@gpsbabel.org
+
+ Based on kml.c, Keyhole "kml" format.
+ Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+#ifndef TEF_XML_H_INCLUDED_
+#define TEF_XML_H_INCLUDED_
+
+#include <QList> // for QList
+#include <QString> // for QString
+#include <QStringView> // for QStringView
+#include <QVector> // for QVector
+#include <QXmlStreamAttributes> // for QXmlStreamAttributes
+
+#include "defs.h" // for arglist_t, ff_cap, ff_cap_none, ARGTYPE_BOOL, ARG_NOMINMAX, CET_CHARSET_UTF8, Waypoint, ff_cap_read, ff_type, ff_type_file, route_head
+#include "format.h" // for Format
+#include "xmlgeneric.h" // for xg_functor_map_entry, xg_string, cb_start, cb_end
+
+
+class TefXMLFormat : public Format
+{
+public:
+ QVector<arglist_t>* get_args() override
+ {
+ return &tef_xml_args;
+ }
+
+ ff_type get_type() const override
+ {
+ return ff_type_file;
+ }
+
+ QVector<ff_cap> get_cap() const override
+ {
+ /* waypoints, tracks, routes */
+ return { ff_cap_none, ff_cap_none, ff_cap_read };
+ }
+
+ QString get_encode() const override
+ {
+ return CET_CHARSET_UTF8;
+ }
+
+ int get_fixed_encode() const override
+ {
+ return 1;
+ }
+
+ void rd_init(const QString& fname) override;
+ void read() override;
+ void rd_deinit() override;
+
+private:
+ /* Member Functions */
+
+ static QString fix_notes(const QString& /*unused*/, const QString& notes);
+ void waypoint_final();
+ static double tef_read_comma_float(QStringView value);
+ void tef_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
+ void tef_header(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
+ void tef_list_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
+ void tef_item_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/);
+ void tef_list_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/);
+ void tef_item_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
+ void tef_point(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
+
+ /* Data Members */
+
+ Waypoint* wpt_tmp{};
+ int item_count{};
+ int waypoints{};
+ double version{};
+ route_head* route = nullptr;
+
+ char* routevia = nullptr;
+
+ QVector<arglist_t> tef_xml_args = {
+ {
+ "routevia", &routevia, "Include only via stations in route",
+ nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
+ }
+ };
+
+ QList<xg_functor_map_entry<TefXMLFormat>> tef_xml_map = {
+ { &TefXMLFormat::tef_start, cb_start, "/TEF" },
+ { &TefXMLFormat::tef_header, cb_start, "/TEF/Header" },
+ { &TefXMLFormat::tef_list_start, cb_start, "/TEF/WaypointList" },
+ { &TefXMLFormat::tef_item_start, cb_start, "/TEF/WaypointList/Item" },
+ { &TefXMLFormat::tef_point, cb_start, "/TEF/WaypointList/Item/Point" },
+ { &TefXMLFormat::tef_item_end, cb_end, "/TEF/WaypointList/Item" },
+ { &TefXMLFormat::tef_list_end, cb_end, "/TEF/WaypointList" }
+ };
+};
+#endif // TEF_XML_H_INCLUDED_
--- /dev/null
+/*
+
+ teletype .way module
+
+ Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+#include "teletype.h"
+
+#include <cstdio> // for SEEK_CUR
+#include "defs.h" // for Waypoint, waypt_add
+
+
+#define MYNAME "teletype"
+
+
+/*******************************************************************************
+* %%% global callbacks called by gpsbabel main process %%% *
+*******************************************************************************/
+
+void
+TeletypeFormat::rd_init(const QString& fname)
+{
+ char header[64];
+
+ fin = gbfopen(fname, "r", MYNAME);
+
+ gbfread(header, sizeof(header), 1, fin);
+ tty_wpt_count = gbfgetint32(fin);
+}
+
+void
+TeletypeFormat::rd_deinit()
+{
+ gbfclose(fin);
+}
+
+void
+TeletypeFormat::read()
+{
+ for (uint32_t i = 0; i < tty_wpt_count; i++) {
+ auto* wpt = new Waypoint;
+ wpt->shortname = (gbfgetcstr(fin));
+ wpt->description = (gbfgetcstr(fin));
+
+ if (true) { // needs bit values of NEWFORMAT2
+ uint32_t direction = gbfgetuint32(fin);
+ uint32_t mins = gbfgetuint32(fin);
+ (void) direction ;
+ (void) mins ;
+ }
+
+ if (true) { // need bit value of NEWFORMAT
+ int len = gbfgetuint16(fin);
+ gbfseek(fin, len, SEEK_CUR);
+ }
+ wpt->latitude = gbfgetint32(fin) / 1000000.0 ;
+ wpt->longitude = gbfgetint32(fin) / 1000000.0 ;
+ gbfseek(fin, 21, SEEK_CUR);
+
+ waypt_add(wpt);
+ }
+}
--- /dev/null
+/*
+
+ teletype .way module
+
+ Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+#ifndef TELETYPE_H_INCLUDED_
+#define TELETYPE_H_INCLUDED_
+
+#include <QString> // for QString
+#include <QVector> // for QVector
+
+#include <cstdint> // for uint32_t
+
+#include "defs.h" // for ff_cap, arglist_t, ff_cap_none, CET_CHARSET_ASCII, ff_cap_read, ff_type, ff_type_file
+#include "format.h" // for Format
+#include "gbfile.h" // for gbfile
+
+
+class TeletypeFormat : public Format
+{
+public:
+ QVector<arglist_t>* get_args() override
+ {
+ return &teletype_args;
+ }
+
+ ff_type get_type() const override
+ {
+ return ff_type_file;
+ }
+
+ QVector<ff_cap> get_cap() const override
+ {
+ /* waypoints, tracks, routes */
+ return {(ff_cap)(ff_cap_read), ff_cap_none, ff_cap_none};
+ }
+
+ QString get_encode() const override
+ {
+ return CET_CHARSET_ASCII;
+ }
+
+ int get_fixed_encode() const override
+ {
+ return 0;
+ }
+
+ void rd_init(const QString& fname) override;
+ void read() override;
+ void rd_deinit() override;
+
+private:
+ /* Data Members */
+
+ uint32_t tty_wpt_count{};
+ gbfile* fin{};
+
+ QVector<arglist_t> teletype_args = {
+ };
+
+};
+#endif // TELETYPE_H_INCLUDED_
--- /dev/null
+/*
+ Read and write TomTom .ov2 files.
+
+ Copyright (C) 2005 Ronald Parker (babeltomtom@parkrrrr.com) and
+ Robert Lipe (robertlipe+source@gpsbabel.org)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+
+/*
+ This module is based on my reverse-engineering of the .ov2 format, so
+ it might not be aware of all record types. In particular, I've seen
+ a type-3 record that may contain additional strings, but since I haven't
+ seen any of those from a legitimate source, I don't know what they are
+ supposed to contain. Thus, they are not currently supported. (The one
+ I saw was due to an errant pair of double-quotes in the input to
+ makeov2.exe.) -- Ron Parker, 28 April 2005
+
+ Because they've been seen in the wild, I have updated the reader to
+ deal with type 3 as if they were type 2. I still haven't seen any
+ records that fill in the other two strings, so until I know for sure
+ that they are indeed strings, I'm just putting them on the end of the
+ description string beyond the NUL terminator. -- Ron Parker, 17 July 2006
+*/
+
+#include <cstdio> // for printf, snprintf, SEEK_CUR, EOF
+#include <cstdlib> // for qsort
+#include <cstring> // for strlen
+
+#include <QString> // for QString
+#include <QtGlobal> // for foreach
+
+#include "defs.h"
+#include "gbfile.h" // for gbfgetint32, gbfputint32, gbfclose, gbfgetc, gbfputc, gbfseek, gbfile, gbfeof, gbfread, gbftell, gbfwrite, gbfopen_le
+
+
+#define MYNAME "TomTom"
+
+static gbfile* file_in;
+static gbfile* file_out;
+
+static
+QVector<arglist_t> tomtom_args = {
+};
+
+static void
+rd_init(const QString& fname)
+{
+ file_in = gbfopen_le(fname, "rb", MYNAME);
+}
+
+static void
+rd_deinit()
+{
+ gbfclose(file_in);
+}
+
+static void
+wr_init(const QString& fname)
+{
+ file_out = gbfopen_le(fname, "wb", MYNAME);
+}
+
+static void
+wr_deinit()
+{
+ gbfclose(file_out);
+}
+
+#define read_long(f) gbfgetint32((f))
+#define read_char(f) gbfgetc((f))
+
+#ifdef DEAD_CODE_IS_REBORN
+/*
+ * Decode a type 8 compressed record
+ */
+static char*
+decode_8(int sz, const unsigned char* inbuf)
+{
+ static const char encoding_8[] = "X. SaerionstldchumgpbkfzvACBMPG-";
+ static const int encoding_8_high[8] = {0x2,0x3,0x4,0x5,0x6,0x7,0xe,0xf};
+
+ // Maximally sized for laziness.
+ char* rval = (char*) xmalloc(sz * 3 + 1);
+ char* out = rval;
+
+ int i;
+ for (i = 0; i < sz;) {
+ if (inbuf[0] & 0x80) {
+ int idx;
+ int res;
+ idx = (inbuf[0] & 0x70) >> 4;
+ res = inbuf[0] & 0x0f;
+ res |= encoding_8_high[idx] << 4;
+
+ *out++ = res;
+
+ inbuf++;
+ i++;
+ } else {
+ int c1 = (inbuf[0] & 0x7c) >> 2;
+ int c2 = ((inbuf[0] & 3) << 3) | (inbuf[1] & 0xe0) >> 5;
+ int c3 = inbuf[1] & 0x1f;
+ if ((c1 | c2 | c3) > 0x1f) {
+ fatal("bit unpacking error");
+ }
+ *out++ = encoding_8[c1];
+ *out++ = encoding_8[c2];
+ *out++ = encoding_8[c3];
+ inbuf+=2;
+ i+=2;
+ }
+ }
+ return rval;
+}
+#endif
+
+#ifdef DEAD_CODE_IS_REBORN
+static void
+decode_latlon(double* lat, double* lon)
+{
+ unsigned char latbuf[3];
+ unsigned char lonbuf[3];
+ double rlat, rlon;
+
+ gbfread(&lonbuf, 3, 1, file_in);
+ gbfread(&latbuf, 3, 1, file_in);
+ rlat = ((latbuf[2] << 16) + (latbuf[1] << 8) + latbuf[0]) / 1000000.0;
+
+ *lat = 80 - rlat;
+ *lon = rlon = 123.456;
+
+}
+#endif
+
+static void
+check_recsize(int sz)
+{
+ if ((sz > 100000) || (sz < 0)) {
+ fatal(MYNAME ":malformed file. Bad record size.");
+ }
+}
+
+static void
+data_read()
+{
+ long recsize;
+ long x;
+ long y;
+ char* desc;
+ Waypoint* wpt_tmp;
+ while (!gbfeof(file_in)) {
+ int rectype = read_char(file_in);
+ if (rectype == EOF) {
+ fatal(MYNAME ":Unexpected EOF.");
+ }
+ if (global_opts.debug_level >= 5) {
+ printf("Reading record type %d\n", rectype);
+ }
+ switch (rectype) {
+ case 0:
+ case 100:
+ if (global_opts.debug_level >= 5) {
+ printf("Skipping deleted record\n");
+ }
+ recsize = read_long(file_in) - 5;
+ check_recsize(recsize);
+ if (global_opts.debug_level >= 5) {
+ printf("Skipping %li bytes\n", recsize);
+ }
+ gbfseek(file_in, recsize, SEEK_CUR);
+ break;
+ case 1:
+ /* a block header; ignored on read */
+ read_long(file_in);
+ read_long(file_in);
+ read_long(file_in);
+ read_long(file_in);
+ read_long(file_in);
+ break;
+ case 2:
+ case 3:
+ recsize = read_long(file_in);
+ check_recsize(recsize);
+ x = read_long(file_in);
+ y = read_long(file_in);
+ desc = (char*)xmalloc(recsize - 13);
+ gbfread(desc, recsize-13, 1, file_in);
+
+ wpt_tmp = new Waypoint;
+
+ wpt_tmp->longitude = x/100000.0;
+ wpt_tmp->latitude = y/100000.0;
+ wpt_tmp->description = STRTOUNICODE(desc);
+ xfree(desc);
+ desc = nullptr;
+ // TODO:: description in rectype 3 contains two zero-terminated strings
+ // First is same as rectype 2, second apparently contains the unique ID of the waypoint
+ // See http://www.tomtom.com/lib/doc/PRO/TTN6_SDK_documentation.zip
+ if (rectype == 3) {
+ warning("Unexpected waypoint record type %d encountered.\nThe unique ID of the POI may have been dropped.\n", rectype);
+ }
+
+ waypt_add(wpt_tmp);
+ break;
+ case 8:
+ case 24:
+#if 0 // Fallthrough for now to silently ignore these until this is done.
+ recsize = read_char(file_in) ;
+ check_recsize(recsize);
+ wpt_tmp = new Waypoint;
+ decode_latlon(&wpt_tmp->latitude, &wpt_tmp->longitude);
+ gbfread(tbuf, 3, 1, file_in);
+ gbfread(tbuf, 3, 1, file_in);
+ gbfread(tbuf, recsize, 1, file_in);
+ wpt_tmp->shortname = decode_8(recsize, tbuf);
+ waypt_add(wpt_tmp);
+ break;
+#else
+#endif
+ case 9:
+ case 25:
+ recsize = read_char(file_in) + 6;
+ check_recsize(recsize);
+ if (global_opts.debug_level >= 5)
+ warning("Unknown record type 0x%x; skipping %ld bytes.\n",
+ rectype, recsize);
+ gbfseek(file_in, recsize, SEEK_CUR);
+ break;
+ default:
+ if (global_opts.debug_level >= 1) {
+ warning("Unexpected waypoint record type: %d at offset 0x%x\n", rectype, gbftell(file_in));
+ }
+ }
+ }
+}
+
+
+struct hdr {
+ const Waypoint* wpt;
+};
+
+static int compare_lon(const void* a, const void* b);
+
+static
+int
+compare_lat(const void* a, const void* b)
+{
+ const auto* wa = (const struct hdr*) a;
+ const auto* wb = (const struct hdr*) b;
+
+ double difference = wa->wpt->latitude - wb->wpt->latitude;
+ if (difference < 0) {
+ return -1;
+ }
+ if (difference) {
+ return 1;
+ }
+ if (wa->wpt->longitude - wb->wpt->longitude == 0) {
+ return wa->wpt->shortname.compare(wb->wpt->shortname);
+ }
+ return compare_lon(a,b);
+}
+
+static
+int
+compare_lon(const void* a, const void* b)
+{
+ const auto* wa = (const struct hdr*)a;
+ const auto* wb = (const struct hdr*)b;
+
+ double difference = wa->wpt->longitude - wb->wpt->longitude;
+ if (difference < 0) {
+ return -1;
+ }
+ if (difference) {
+ return 1;
+ }
+ if (wa->wpt->latitude - wb->wpt->latitude == 0) {
+ return wa->wpt->shortname.compare(wb->wpt->shortname);
+ }
+ return compare_lat(a,b);
+}
+
+#define write_long(f,v) gbfputint32((v),f)
+
+static void
+write_float_as_long(gbfile* file, double value)
+{
+ long tmp = (value + 0.500000000001);
+ write_long(file, tmp);
+}
+
+#define write_char(f,c) gbfputc((c),f)
+#define write_string(f,s) gbfwrite((s),1,strlen(s)+1,f)
+
+struct blockheader {
+ struct hdr* start;
+ long count;
+ long size;
+ double minlat;
+ double maxlat;
+ double minlon;
+ double maxlon;
+ struct blockheader* ch1;
+ struct blockheader* ch2;
+};
+
+static void
+write_blocks(gbfile* f, struct blockheader* blocks)
+{
+ write_char(f, 1);
+ write_long(f, blocks->size);
+ write_float_as_long(f, blocks->maxlon*100000);
+ write_float_as_long(f, blocks->maxlat*100000);
+ write_float_as_long(f, blocks->minlon*100000);
+ write_float_as_long(f, blocks->minlat*100000);
+ if (blocks->ch1) {
+ write_blocks(f, blocks->ch1);
+ }
+ if (blocks->ch2) {
+ write_blocks(f, blocks->ch2);
+ }
+ if (!blocks->ch1 && !blocks->ch2) {
+ for (int i = 0; i < blocks->count; i++) {
+ char desc_field [256];
+ write_char(f, 2);
+ if (global_opts.smart_names &&
+ blocks->start[i].wpt->gc_data->diff &&
+ blocks->start[i].wpt->gc_data->terr) {
+ snprintf(desc_field,sizeof(desc_field),"%s(t%ud%u)%s(type%dcont%d)",STRFROMUNICODE(blocks->start[i].wpt->description),
+ blocks->start[i].wpt->gc_data->terr/10,
+ blocks->start[i].wpt->gc_data->diff/10,
+ STRFROMUNICODE(blocks->start[i].wpt->shortname),
+ (int) blocks->start[i].wpt->gc_data->type,
+ (int) blocks->start[i].wpt->gc_data->container);
+ //Unfortunately enums mean we get numbers for cache type and container.
+ } else {
+ snprintf(desc_field, sizeof(desc_field), "%s",
+ STRFROMUNICODE(blocks->start[i].wpt->description));
+ }
+ write_long(f, strlen(desc_field) + 14);
+ write_float_as_long(f, blocks->start[i].wpt->longitude*100000);
+ write_float_as_long(f, blocks->start[i].wpt->latitude*100000);
+ write_string(f, desc_field);
+ }
+ }
+}
+
+static struct blockheader*
+compute_blocks(struct hdr* start, int count,
+ double minlon, double maxlon, double minlat, double maxlat)
+{
+ auto* newblock = (struct blockheader*)xcalloc(1, sizeof(struct blockheader));
+ newblock->start = start;
+ newblock->count = count;
+ newblock->minlon = minlon;
+ newblock->maxlon = maxlon;
+ newblock->minlat = minlat;
+ newblock->maxlat = maxlat;
+ newblock->size = 4 * 5 + 1; /* hdr is 5 longs, 1 char */
+ if (count < 20) {
+ for (int i = 0; i < count; i++) {
+ newblock->size += 4 * 3 + 1;
+ /* wpt const part 3 longs, 1 char */
+ const Waypoint* wpt = start[i].wpt;
+ newblock->size += wpt->description.length() + 1;
+ }
+ } else {
+ if ((maxlat-minlat)>(maxlon-minlon)) {
+ /* split along lats */
+ qsort(start, count, sizeof(*start), compare_lat);
+ newblock->ch1 = compute_blocks(start, count/2,
+ minlon, maxlon, minlat,
+ start[count/2].wpt->latitude);
+ newblock->ch2 = compute_blocks(start+count/2,
+ count-count/2, minlon, maxlon,
+ start[count/2].wpt->latitude, maxlat);
+ } else {
+ /* split along lons */
+ qsort(start, count, sizeof(*start), compare_lon);
+ newblock->ch1 = compute_blocks(start, count/2,
+ minlon, start[count/2].wpt->longitude,
+ minlat, maxlat);
+ newblock->ch2 = compute_blocks(start+count/2,
+ count-count/2, start[count/2].wpt->longitude,
+ maxlon, minlat, maxlat);
+ }
+ if (newblock->ch1) {
+ newblock->size += newblock->ch1->size;
+ }
+ if (newblock->ch2) {
+ newblock->size += newblock->ch2->size;
+ }
+ }
+ return newblock;
+}
+
+static void
+free_blocks(struct blockheader* block)
+{
+ if (block->ch1) {
+ free_blocks(block->ch1);
+ }
+ if (block->ch2) {
+ free_blocks(block->ch2);
+ }
+ xfree(block);
+}
+
+static void
+data_write()
+{
+ int ct = waypt_count();
+ struct hdr* htable, *bh;
+ extern WaypointList* global_waypoint_list;
+ double minlon = 200;
+ double maxlon = -200;
+ double minlat = 200;
+ double maxlat = -200;
+ struct blockheader* blocks = nullptr;
+
+ htable = (struct hdr*) xmalloc(ct * sizeof(*htable));
+ bh = htable;
+
+ // Iterate with waypt_disp_all?
+ for (const Waypoint* waypointp : qAsConst(*global_waypoint_list)) {
+ bh->wpt = waypointp;
+ if (waypointp->longitude > maxlon) {
+ maxlon = waypointp->longitude;
+ }
+ if (waypointp->longitude < minlon) {
+ minlon = waypointp->longitude;
+ }
+ if (waypointp->latitude > maxlat) {
+ maxlat = waypointp->latitude;
+ }
+ if (waypointp->latitude < minlat) {
+ minlat = waypointp->latitude;
+ }
+ bh ++;
+ }
+
+ blocks = compute_blocks(htable, ct, minlon, maxlon, minlat, maxlat);
+ write_blocks(file_out, blocks);
+ free_blocks(blocks);
+
+ xfree(htable);
+}
+
+ff_vecs_t tomtom_vecs = {
+ ff_type_file,
+ FF_CAP_RW_WPT,
+ rd_init,
+ wr_init,
+ rd_deinit,
+ wr_deinit,
+ data_read,
+ data_write,
+ nullptr,
+ &tomtom_args,
+ CET_CHARSET_MS_ANSI, 0 /* CET-REVIEW */
+ , NULL_POS_OPS
+};
--- /dev/null
+/*
+
+ Wintec tes support.
+
+ Copyright (C) 2010 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+#include "wintec_tes.h"
+
+#include <ctime> // for time_t, tm
+#include <cstring> // for memset
+
+#include "defs.h" // for Waypoint, mkgmtime, track_add_head, track_add_wpt, waypt_add, route_head
+
+
+#define MYNAME "wintec_tes"
+
+void
+WintecTesFormat::rd_init(const QString& fname)
+{
+ fin = gbfopen(fname, "r", MYNAME);
+}
+
+void
+WintecTesFormat::rd_deinit()
+{
+ gbfclose(fin);
+}
+
+time_t
+WintecTesFormat::wintec_date_to_time(uint32_t w)
+{
+ struct tm tm;
+ memset(&tm, 0, sizeof(tm));
+ tm.tm_sec = ((w & 0x0000003f));
+ tm.tm_min = ((w & 0x00000fc0) >> 6);
+ tm.tm_hour = ((w & 0x0001f000) >> 12);
+ tm.tm_mday = ((w & 0x003f0000) >> 17);
+ tm.tm_mon = ((w & 0x03c00000) >> 22) - 1;
+ tm.tm_year = ((w & 0xfc000000) >> 26) + 100;
+
+ return mkgmtime(&tm);
+}
+
+void
+WintecTesFormat::read()
+{
+ auto* trk = new route_head;
+ track_add_head(trk);
+
+ while (!gbfeof(fin)) {
+ uint16_t flags = gbfgetuint16(fin);
+ uint32_t date = gbfgetuint32(fin);
+ int32_t latitude = gbfgetint32(fin);
+ int32_t longitude = gbfgetint32(fin);
+ int16_t alt = gbfgetint16(fin); // Signed. Meters.
+
+ (void) flags; // Silence 'unused' warning until we use flags.
+ auto* wpt = new Waypoint;
+ wpt->latitude = latitude / 1.0e7;
+ wpt->longitude = longitude / 1.0e7;
+ wpt->SetCreationTime(wintec_date_to_time(date));
+ // The unit of altitude isn't clear and we have a lot of
+ // samples with wildly negative values, so ignore those for now.
+ wpt->altitude = alt;
+
+ // The description given to us says this is a bitmask with
+ // 0x01 "split mark" (not at all clear what that is)
+ // 0x02 interest point
+ // 0x04 track point
+ // But of the files we've seen, none have had > 1 bit set
+ // and none have had 0x04 set.
+ // Wintec's software puts a waypoint in the track, so we
+ // mock that.
+ if (flags & 0x02) {
+ auto* temp = new Waypoint(*wpt);
+ waypt_add(temp);
+ }
+
+ track_add_wpt(trk, wpt);
+ }
+}
--- /dev/null
+/*
+
+ Wintec tes support.
+
+ Copyright (C) 2010 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+#ifndef WINTEC_TES_H_INCLUDED_
+#define WINTEC_TES_H_INCLUDED_
+
+#include <QString> // for QString
+#include <QVector> // for QVector
+
+#include <cstdint> // for uint32_t
+#include <ctime> // for time_t
+
+#include "defs.h" // for ff_cap, arglist_t, ff_cap_read, CET_CHARSET_ASCII, ff_cap_none, ff_type, ff_type_file
+#include "format.h" // for Format
+#include "gbfile.h" // for gbfile
+
+
+class WintecTesFormat : public Format
+{
+public:
+ QVector<arglist_t>* get_args() override
+ {
+ return &wintec_tes_args;
+ }
+
+ ff_type get_type() const override
+ {
+ return ff_type_file;
+ }
+
+ QVector<ff_cap> get_cap() const override
+ {
+ /* waypoints, tracks, routes */
+ return { ff_cap_read, ff_cap_read, ff_cap_none };
+ }
+
+ QString get_encode() const override
+ {
+ return CET_CHARSET_ASCII;
+ }
+
+ int get_fixed_encode() const override
+ {
+ return 0;
+ }
+
+ void rd_init(const QString& fname) override;
+ void read() override;
+ void rd_deinit() override;
+
+private:
+ /* Member Functions */
+
+ static time_t wintec_date_to_time(uint32_t w);
+
+ /* Data Members */
+
+ gbfile* fin{};
+
+ QVector<arglist_t> wintec_tes_args = {
+ };
+
+};
+#endif // WINTEC_TES_H_INCLUDED_
--- /dev/null
+/*
+
+ Support for Swiss Map # (.xol) format
+
+ Copyright (C) 2007 Olaf Klein, o.b.klein@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "defs.h"
+#include "garmin_tables.h"
+#include "jeeps/gpsmath.h"
+#include "src/core/file.h"
+#include "src/core/xmlstreamwriter.h"
+#include "xmlgeneric.h"
+
+#include <QXmlStreamAttributes>
+#include <QXmlStreamWriter>
+
+static Waypoint* wpt_;
+static route_head* trk_;
+static bounds all_bounds;
+static short_handle short_h;
+
+static gpsbabel::File* oqfile;
+static gpsbabel::XmlStreamWriter* writer;
+
+static QVector<arglist_t> xol_args = {};
+
+#define MYNAME "xol"
+
+static xg_callback xol_shape, xol_shape_end;
+static xg_callback xol_waypt, xol_overlay;
+
+#define XOL "/overlays/overlay"
+
+static xg_tag_mapping xol_map[] = {
+ { xol_overlay, cb_start, XOL },
+ { xol_shape, cb_start, XOL "/shapes/*shape" },
+ { xol_shape_end, cb_end, XOL "/shapes/*shape" },
+ { xol_waypt, cb_start, XOL "/shapes/shape/*points/point" },
+ { nullptr, (xg_cb_type)0, nullptr} };
+
+static void xol_overlay(xg_string, const QXmlStreamAttributes* attrv) {
+ if (attrv->hasAttribute("version")) {
+ if (attrv->value("version") != u"1.0") {
+ fatal(MYNAME ": Unsupported version %s.\n",
+ qPrintable(attrv->value("version").toString()));
+ }
+ }
+}
+
+static void xol_shape(xg_string, const QXmlStreamAttributes* attrv) {
+ if (attrv->hasAttribute("type")) {
+ if (attrv->value("type") == u"waypoint") {
+ wpt_ = new Waypoint;
+ } else if (attrv->value("type") == u"polyline") {
+ trk_ = new route_head;
+ track_add_head(trk_);
+ }
+ }
+
+ if (attrv->hasAttribute("name")) {
+ if (wpt_) {
+ wpt_->shortname = attrv->value("name").toString();
+ } else if (trk_) {
+ trk_->rte_name = attrv->value("name").toString();
+ }
+ }
+
+ if (wpt_) {
+ if (attrv->hasAttribute("comment")) {
+ wpt_->notes = attrv->value("comment").toString();
+ }
+
+ if (attrv->hasAttribute("alt")) {
+ wpt_->altitude = attrv->value("alt").toDouble();
+ }
+
+ if (attrv->hasAttribute("timestamp")) {
+ wpt_->creation_time = xml_parse_time(
+ attrv->value("timestamp").toString());
+ }
+
+ if (attrv->hasAttribute("icon")) {
+ wpt_->icon_descr = attrv->value("icon").toString();
+ }
+ }
+}
+
+static void xol_shape_end(xg_string, const QXmlStreamAttributes*) {
+ if (wpt_) {
+ if (trk_) {
+ track_add_wpt(trk_, wpt_);
+ } else {
+ waypt_add(wpt_);
+ }
+ wpt_ = nullptr;
+ } else if (trk_) {
+ if (trk_->rte_waypt_ct() == 0) {
+ track_del_head(trk_);
+ }
+ trk_ = nullptr;
+ }
+}
+
+static void xol_waypt(xg_string, const QXmlStreamAttributes* attrv) {
+ int x = 0, y = 0;
+
+ if (attrv->hasAttribute("y")) {
+ y = attrv->value("y").toInt();
+ }
+
+ if (attrv->hasAttribute("x")) {
+ x = attrv->value("x").toInt();
+ }
+
+ GPS_Math_Swiss_EN_To_WGS84(x, y, &wpt_->latitude, &wpt_->longitude);
+}
+
+static void xol_rd_init(const QString& fname) {
+ trk_ = nullptr;
+ wpt_ = nullptr;
+
+ xml_init(fname, xol_map, nullptr);
+}
+
+static void xol_read() { xml_read(); }
+
+static void xol_rd_deinit() { xml_deinit(); }
+
+/* writer */
+
+static void xol_fatal_outside(const Waypoint* waypoint) {
+ fatal(MYNAME ": %s (%s) is outside of convertible area \"%s\"!\n",
+ waypoint->shortname.isEmpty() ? "Waypoint" : qPrintable(waypoint->shortname),
+ pretty_deg_format(waypoint->latitude, waypoint->longitude, 'd', nullptr, 0),
+ gt_get_mps_grid_longname(grid_swiss, MYNAME));
+}
+
+static void xol_waypt_bound_calc(const Waypoint* waypoint) {
+ waypt_add_to_bounds(&all_bounds, waypoint);
+}
+
+static void xol_wr_init(const QString& fname) {
+ oqfile = new gpsbabel::File(fname);
+ oqfile->open(QIODevice::WriteOnly | QIODevice::Text);
+
+ writer = new gpsbabel::XmlStreamWriter(oqfile);
+ writer->setAutoFormattingIndent(2);
+ writer->writeStartDocument();
+
+ waypt_init_bounds(&all_bounds);
+ short_h = mkshort_new_handle();
+
+ setshort_length(short_h, 1024); /* ??? */
+ setshort_badchars(short_h, "\r\n\t");
+ setshort_mustupper(short_h, 0);
+ setshort_mustuniq(short_h, 1);
+ setshort_whitespace_ok(short_h, 1);
+ setshort_repeating_whitespace_ok(short_h, 1);
+ setshort_defname(short_h, "Waypoint");
+}
+
+static void xol_wr_deinit() {
+ mkshort_del_handle(&short_h);
+ writer->writeEndDocument();
+ delete writer;
+ writer = nullptr;
+
+ oqfile->close();
+ delete oqfile;
+ oqfile = nullptr;
+}
+
+static void xol_waypt_disp_cb(const Waypoint* wpt) {
+ double x, y;
+
+ QString name = wpt->shortname;
+ if (name.isEmpty() || global_opts.synthesize_shortnames) {
+ name = mkshort_from_wpt(short_h, wpt);
+ } else {
+ name = mkshort(short_h, name);
+ }
+
+ if (!GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &x, &y)) {
+ xol_fatal_outside(wpt);
+ }
+ writer->writeStartElement(QStringLiteral("shape"));
+ writer->writeAttribute(QStringLiteral("type"), QStringLiteral("waypoint"));
+ writer->writeAttribute(QStringLiteral("name"), name);
+ writer->writeAttribute(QStringLiteral("comment"), wpt->notes);
+ writer->writeAttribute(QStringLiteral("icon"), wpt->icon_descr);
+
+ if (wpt->creation_time.isValid()) {
+ writer->writeAttribute(QStringLiteral("timestamp"), wpt->CreationTimeXML());
+ }
+ if (wpt->altitude != unknown_alt) {
+ writer->writeAttribute(QStringLiteral("alt"), QString::number(wpt->altitude, 'f', 6));
+ }
+ writer->writeStartElement(QStringLiteral("points"));
+ writer->writeStartElement(QStringLiteral("point"));
+ writer->writeAttribute(QStringLiteral("x"), QString::number(x));
+ writer->writeAttribute(QStringLiteral("y"), QString::number(y));
+ writer->writeEndElement(); // point
+ writer->writeEndElement(); // points
+ writer->writeEndElement(); // shape
+}
+
+static void xol_track_hdr_disp_cb(const route_head*) {
+ writer->writeStartElement(QStringLiteral("shape"));
+ writer->writeAttribute(QStringLiteral("type"), QStringLiteral("polyline"));
+ writer->writeAttribute(QStringLiteral("lineSize"), QStringLiteral("3"));
+ writer->writeAttribute(QStringLiteral("lineColor"), QStringLiteral("#e60000"));
+ writer->writeAttribute(QStringLiteral("lineStyle"), QStringLiteral("solid"));
+ writer->writeStartElement(QStringLiteral("waypoints"));
+}
+
+static void xol_track_tlr_disp_cb(const route_head*) {
+ writer->writeEndElement(); // waypoints
+ writer->writeEndElement(); // shape
+}
+
+static void xol_trkpt_disp_cb(const Waypoint* wpt) {
+ double x, y;
+
+ if (!GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &x, &y)) {
+ xol_fatal_outside(wpt);
+ }
+
+ writer->writeStartElement(QStringLiteral("shape"));
+ writer->writeAttribute(QStringLiteral("type"), QStringLiteral("waypoint"));
+ if (wpt->creation_time.isValid()) {
+ writer->writeAttribute(QStringLiteral("timestamp"), wpt->CreationTimeXML());
+ }
+ if (wpt->altitude != unknown_alt) {
+ writer->writeAttribute(QStringLiteral("alt"), QString::number(wpt->altitude, 'f'));
+ }
+
+ writer->writeStartElement(QStringLiteral("points"));
+ writer->writeStartElement(QStringLiteral("point"));
+ writer->writeAttribute(QStringLiteral("x"), QString::number(x));
+ writer->writeAttribute(QStringLiteral("y"), QString::number(y));
+ writer->writeEndElement(); // point
+ writer->writeEndElement(); // points
+ writer->writeEndElement(); // shape
+}
+
+static void xol_write() {
+ double x, y;
+
+ waypt_disp_all(xol_waypt_bound_calc);
+ track_disp_all(nullptr, nullptr, xol_waypt_bound_calc);
+
+ if (!waypt_bounds_valid(&all_bounds)) {
+ fatal(MYNAME ": No data available!\n");
+ }
+
+ if (!GPS_Math_WGS84_To_Swiss_EN((all_bounds.min_lat + all_bounds.max_lat) / 2,
+ (all_bounds.min_lon + all_bounds.max_lon) / 2,
+ &x, &y)) {
+ fatal(MYNAME
+ ": At least one point is outside of convertible area \"%s\"!\n",
+ gt_get_mps_grid_longname(grid_swiss, MYNAME));
+ }
+
+ writer->setAutoFormatting(true);
+ writer->writeStartElement(QStringLiteral("overlays"));
+ writer->writeStartElement(QStringLiteral("overlay"));
+ writer->writeAttribute(QStringLiteral("version"), QStringLiteral("1.0"));
+ writer->writeStartElement(QStringLiteral("center"));
+ writer->writeAttribute(QStringLiteral("x"), QString::number(x));
+ writer->writeAttribute(QStringLiteral("y"), QString::number(y));
+ writer->writeEndElement(); // center
+ writer->writeStartElement(QStringLiteral("shapes"));
+
+ waypt_disp_all(xol_waypt_disp_cb);
+ track_disp_all(xol_track_hdr_disp_cb, xol_track_tlr_disp_cb,
+ xol_trkpt_disp_cb);
+
+ writer->writeEndElement(); // shapes
+ writer->writeEndElement(); // overlay
+}
+
+ff_vecs_t xol_vecs = {ff_type_file,
+ {(ff_cap)(ff_cap_read | ff_cap_write), /* waypoints */
+ (ff_cap)(ff_cap_read | ff_cap_write), /* tracks */
+ ff_cap_none}, /* routes */
+ xol_rd_init,
+ xol_wr_init,
+ xol_rd_deinit,
+ xol_wr_deinit,
+ xol_read,
+ xol_write,
+ nullptr,
+ &xol_args,
+ CET_CHARSET_UTF8,
+ 0 , NULL_POS_OPS
+};
+++ /dev/null
-/*
-
- Support for TrackLogs digital mapping (.trl) files,
-
- Copyright (C) 2006,2007 Olaf Klein, o.b.klein@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-#include <cstdio> // for SEEK_CUR, size_t
-#include <cstdint> // int32_t, int16_t, uint32_t
-#include <cstdlib> // for atoi
-#include <cstring> // for strncmp, memcpy, strcmp, strlen
-
-#include <QByteArray> // for QByteArray
-#include <QString> // for QString, operator+
-#include <QXmlStreamAttributes> // for QXmlStreamAttributes
-#include <QtGlobal> // for qPrintable
-
-#include "defs.h"
-#include "gbfile.h" // for gbfgetdbl, gbfgetint32, gbfputint32, gbfgetint16, gbfputdbl, gbfputc, gbfread, gbfseek, gbfgetc, gbfile, gbfclose, gbfungetc, gbfeof, gbfputs, gbfwrite, gbfopen_le, gbfgetuint32, gbfputuint16, gbfputuint32
-#include "jeeps/gpsmath.h" // for GPS_Lookup_Datum_Index, GPS_Math_Known_Datum_To_WGS84_C, GPS_Math_NGENToAiry1830LatLon
-#include "src/core/logging.h" // for FatalMsg
-#include "xmlgeneric.h" // for cb_cdata, xg_callback, xg_string, xml_deinit, xml_init, cb_end, cb_start, xg_cb_type, xml_read, xml_readstring, xg_tag_mapping
-
-
-#define MYNAME "dmtlog"
-
-#define DEFLATE_BUFF_SIZE 16384
-
-static gbfile* fin, *fout;
-
-static char* xmlbin;
-static Waypoint* xmlwpt;
-static route_head* xmltrk;
-static QString xmlgrid;
-static int xmldatum;
-static double xmlEasting, xmlNorthing;
-static double xmlLatitude, xmlLongitude;
-static double xmlAltitude;
-
-#if !ZLIB_INHIBITED
-static int xmlbinsize;
-#endif
-
-static char header_written;
-static char* opt_index;
-static int track_index, this_index;
-
-static
-QVector<arglist_t> dmtlog_args = {
- {
- "index", &opt_index,
- "Index of track (if more than one in source)", "1", ARGTYPE_INT, "1", nullptr, nullptr
- },
-};
-
-
-#if !ZLIB_INHIBITED
-static xg_callback tlog3a_xgcb_version, tlog3a_xgcb_length, tlog3a_xgcb_data;
-
-static xg_tag_mapping tlog3a_xgcb_map[] = {
- { tlog3a_xgcb_version, cb_cdata, "/CXMLSafe/Version" },
- { tlog3a_xgcb_length, cb_cdata, "/CXMLSafe/Length" },
- { tlog3a_xgcb_data, cb_cdata, "/CXMLSafe/Data" },
- { nullptr, (xg_cb_type)0, nullptr}
-};
-#endif
-
-static xg_callback tlog3b_xgcb_tfna, tlog3b_xgcb_tfdes;
-static xg_callback tlog3b_xgcb_wptst, tlog3b_xgcb_tptst;
-static xg_callback tlog3b_xgcb_tpten, tlog3b_xgcb_wpten;
-static xg_callback tlog3b_xgcb_wptid, tlog3b_xgcb_wptdt;
-static xg_callback tlog3b_xgcb_wptgr, tlog3b_xgcb_wptea;
-static xg_callback tlog3b_xgcb_wptno, tlog3b_xgcb_wptal;
-static xg_callback tlog3b_xgcb_tptdt;
-
-static xg_tag_mapping tlog3b_xgcb_map[] = {
- { tlog3b_xgcb_tfna, cb_cdata, "/CTrackFile/Name" },
- { tlog3b_xgcb_tfdes, cb_cdata, "/CTrackFile/Description" },
- { tlog3b_xgcb_wptst, cb_start, "/CTrackFile/CWayPoint" },
- { tlog3b_xgcb_wptid, cb_cdata, "/CTrackFile/CWayPoint/Id" },
- { tlog3b_xgcb_wptdt, cb_cdata, "/CTrackFile/CWayPoint/Datum" },
- { tlog3b_xgcb_wptgr, cb_cdata, "/CTrackFile/CWayPoint/Grid" },
- { tlog3b_xgcb_wptea, cb_cdata, "/CTrackFile/CWayPoint/Easting" },
- { tlog3b_xgcb_wptno, cb_cdata, "/CTrackFile/CWayPoint/Northing" },
- { tlog3b_xgcb_wptal, cb_cdata, "/CTrackFile/CWayPoint/Altitude" },
- { tlog3b_xgcb_wpten, cb_end, "/CTrackFile/CWayPoint" },
- { tlog3b_xgcb_tptst, cb_start, "/CTrackFile/CTrackPoint" },
- { tlog3b_xgcb_wptid, cb_cdata, "/CTrackFile/CTrackPoint/Id" },
- { tlog3b_xgcb_tptdt, cb_cdata, "/CTrackFile/CTrackPoint/Datum" },
- { tlog3b_xgcb_wptgr, cb_cdata, "/CTrackFile/CTrackPoint/Grid" },
- { tlog3b_xgcb_wptea, cb_cdata, "/CTrackFile/CTrackPoint/Easting" },
- { tlog3b_xgcb_wptno, cb_cdata, "/CTrackFile/CTrackPoint/Northing" },
- { tlog3b_xgcb_wptal, cb_cdata, "/CTrackFile/CTrackPoint/Altitude" },
- { tlog3b_xgcb_tpten, cb_end, "/CTrackFile/CTrackPoint" },
- { nullptr, (xg_cb_type)0, nullptr}
-};
-
-/* helpers */
-
-static void
-convert_datum(Waypoint* wpt, int datum)
-{
- if (datum != DATUM_WGS84) {
- double lat = wpt->latitude;
- double lon = wpt->longitude;
- double alt = wpt->altitude;
- GPS_Math_Known_Datum_To_WGS84_C(lat, lon, alt,
- &wpt->latitude, &wpt->longitude, &wpt->altitude,
- datum);
- }
-}
-
-
-static void
-finalize_pt(Waypoint* wpt)
-{
- if (xmlgrid == "BNG") {
- GPS_Math_NGENToAiry1830LatLon(xmlEasting, xmlNorthing,
- &wpt->latitude, &wpt->longitude);
- xmldatum = DATUM_OSGB36;
- } else {
- wpt->latitude = xmlLatitude;
- wpt->longitude = xmlLongitude;
- }
- /* NOTE:
- * Alan White reports this program actually subtracts a number
- * of meters ranging between 46 and 50 meters. It appears to be
- * constant for each location, but different without an obvious
- * correlation to ground altitude. We considered offsetting this
- * in GPSBabel, but concluded it wasn't worth the bother.
- * If we get complaints, probably all of our alt reading and writing
- * should offset an average of 46m or so.
- */
- wpt->altitude = xmlAltitude;
- convert_datum(wpt, xmldatum);
-}
-
-/* xml-reader callbacks */
-
-#if !ZLIB_INHIBITED
-static void
-tlog3a_xgcb_version(xg_string args, const QXmlStreamAttributes*)
-{
- if (args != "1") {
- fatal(MYNAME ": Unsupported file version '%s'!\n", qPrintable(args));
- }
-}
-
-static void
-tlog3a_xgcb_length(xg_string, const QXmlStreamAttributes*)
-{
-}
-
-static void
-tlog3a_xgcb_data(xg_string args, const QXmlStreamAttributes*)
-{
- int len;
- char* bin;
- char* cin, *cout;
- char cl, ch;
- //TODO This function needs rethinking.
- len = args.length();
- bin = (char*) xmalloc((len >> 1) + 1);
-
- char* cincopy = xstrdup(args);
- cin = cincopy;
- cout = bin;
-
- cl = 0x10;
- while (*cin) {
- char c = *cin++;
-
- if (c == '\0') {
- break;
- } else if ((c >= 'A') && (c <= 'F')) {
- c -= 'A' - 10;
- } else if ((c >= 'a') && (c <= 'f')) {
- c -= 'a' - 10;
- } else if ((c >= '0') && (c <= '9')) {
- c -= '0';
- } else {
- continue;
- }
-
- if (cl == 0x10) {
- cl = c;
- } else {
- ch = (cl << 4) | c;
- *cout++ = ch;
- cl = 0x10;
- }
- }
- xmlbin = bin;
- xmlbinsize = (cout - bin);
- xfree(cincopy);
-}
-#endif
-
-
-static void
-tlog3b_xgcb_tfna(xg_string args, const QXmlStreamAttributes*)
-{
- if (xmltrk == nullptr) {
- xmltrk = new route_head;
- track_add_head(xmltrk);
- }
- xmltrk->rte_name = args;
-}
-
-
-static void
-tlog3b_xgcb_tfdes(xg_string args, const QXmlStreamAttributes*)
-{
- if (xmltrk == nullptr) {
- xmltrk = new route_head;
- track_add_head(xmltrk);
- }
- xmltrk->rte_desc = args;
-}
-
-
-static void
-tlog3b_xgcb_wptst(xg_string, const QXmlStreamAttributes*)
-{
- xmlwpt = new Waypoint;
- xmldatum = DATUM_WGS84;
-}
-
-
-static void
-tlog3b_xgcb_tptst(xg_string, const QXmlStreamAttributes*)
-{
- xmlwpt = new Waypoint;
- xmldatum = DATUM_WGS84;
-}
-
-
-static void
-tlog3b_xgcb_tpten(xg_string, const QXmlStreamAttributes*)
-{
- finalize_pt(xmlwpt);
-
- if (xmltrk == nullptr) {
- xmltrk = new route_head;
- track_add_head(xmltrk);
- }
- track_add_wpt(xmltrk, xmlwpt);
- xmlwpt = nullptr;
-}
-
-
-static void
-tlog3b_xgcb_wptid(xg_string args, const QXmlStreamAttributes*)
-{
- xmlwpt->shortname = args;
-}
-
-
-static void
-tlog3b_xgcb_wptdt(xg_string args, const QXmlStreamAttributes*)
-{
- xmldatum = GPS_Lookup_Datum_Index(args);
-}
-
-
-static void
-tlog3b_xgcb_wptgr(xg_string args, const QXmlStreamAttributes*)
-{
- xmlgrid = args;
-/*
- if (xmlgrid != NULL) {
- if (strcmp(xmlgrid, args) == 0) {
- return;
- }
- xfree(xmlgrid);
- }
- xmlgrid = xstrdup(args);
-*/
-}
-
-
-static void
-tlog3b_xgcb_wptno(xg_string args, const QXmlStreamAttributes*)
-{
- xmlNorthing = args.toDouble();
-}
-
-static void
-tlog3b_xgcb_wptea(xg_string args, const QXmlStreamAttributes*)
-{
- xmlEasting = args.toDouble();
-}
-
-
-static void
-tlog3b_xgcb_wptal(xg_string args, const QXmlStreamAttributes*)
-{
- xmlAltitude = args.toDouble();
-}
-
-
-static void
-tlog3b_xgcb_tptdt(xg_string args, const QXmlStreamAttributes*)
-{
- xmldatum = GPS_Lookup_Datum_Index(args);
-}
-
-
-static void
-tlog3b_xgcb_wpten(xg_string, const QXmlStreamAttributes*)
-{
- finalize_pt(xmlwpt);
- waypt_add(xmlwpt);
- xmlwpt = nullptr;
-}
-
-
-static QString
-read_str(gbfile* f)
-{
- int i = gbfgetc(f);
- if (i == 0xff) {
- i = gbfgetint16(f);
- }
-
- return gbfreadbuf(i, f);
-}
-
-static void
-write_str(const char* str, gbfile* f)
-{
- if (str && *str) {
- int len = strlen(str);
- if (len > 0xfe) {
-#if 0
- if (len > 0x7fff) {
- len = 0x7fff;
- }
- gbfputc((unsigned char) 0xff, f);
- gbfputint16(len, f);
-#else
- len = 0xfe;
- gbfputc(len, f);
-#endif
- } else {
- gbfputc(len, f);
- }
- gbfwrite(str, len, 1, f);
- } else {
- gbfputc(0, f);
- }
-}
-
-static void
-write_str(const QString& str, gbfile* f)
-{
- write_str(CSTR(str), f);
-}
-
-static int
-read_datum(gbfile* f)
-{
- auto d = read_str(f);
- auto g = read_str(f);
-
- int res = GPS_Lookup_Datum_Index(d);
-
- if (d.compare(g)) {
- fatal(FatalMsg() << MYNAME << ": Unsupported combination of datum '" << d << "' and grid '" << g << "''!\n");
- }
-
- return res;
-}
-
-
-static void
-read_CTrackFile(const int version)
-{
- int16_t u1 = gbfgetint16(fin);
-
- char buf[128];
- gbfread(buf, 1, 10, fin);
- if ((u1 != 0x0a) || (strncmp("CTrackFile", buf, 10) != 0)) {
- fatal(MYNAME ": Unknown or invalid track file.\n");
- }
-
- if (version == 8) {
- gbfseek(fin, 36, SEEK_CUR); /* skip unknown 36 bytes */
- }
-
- int32_t ver = gbfgetint32(fin);
- if (ver != version) {
- fatal(MYNAME ": Unknown or invalid track file (%d).\n", ver);
- }
-
- (void) gbfgetint32(fin); // Unknown 2
- (void) gbfgetint32(fin); // Unknown 3
- (void) gbfgetint32(fin); // Unknown 4
-
- auto* track = new route_head;
- track_add_head(track);
-
- /* S1 .. S9: comments, hints, jokes, aso */
- for (int i = 0; i < 9; i++) {
- (void) read_str(fin);
- }
-
- int32_t tcount = gbfgetint32(fin);
- int datum = 118;
- if (tcount > 0) {
- datum = read_datum(fin);
- if (version == 8) {
- gbfread(buf, 1, 4, fin);
- int len = gbfgetint16(fin);
- gbfseek(fin, len, SEEK_CUR);
- }
- }
-
- while (tcount > 0) {
- tcount--;
-
- if (version == 8) {
- datum = read_datum(fin);
- }
-
- auto* wpt = new Waypoint;
-
- wpt->latitude = gbfgetdbl(fin);
- wpt->longitude = gbfgetdbl(fin);
- wpt->altitude = gbfgetdbl(fin);
-
- if (datum < 0) {
- fatal(MYNAME ": Invalid datum %d found", datum);
- }
- convert_datum(wpt, datum);
-
- track_add_wpt(track, wpt);
-
- if (version == 8) {
- gbfseek(fin, 34, SEEK_CUR); /* skip unknown 34 bytes */
- }
- }
-
- if (version == 8) {
-
- int i = gbfgetint16(fin);
- i = gbfgetc(fin);
- if (i == 0) {
- return;
- }
-
- gbfungetc(i, fin);
- datum = read_datum(fin);
-
- (void) gbfgetint16(fin);
- (void) gbfgetint32(fin);
-
- gbfread(buf, 1, 9, fin);
- if (strncmp(buf, "CWayPoint", 9) != 0) {
- warning(MYNAME ": Unsupported waypoint structure!\n");
- return;
- }
-
- while (! gbfeof(fin)) {
- i = gbfgetc(fin);
- if (i == 0) {
- break;
- }
-
- gbfungetc(i, fin);
- datum = read_datum(fin);
-
- auto* wpt = new Waypoint;
-
- wpt->latitude = gbfgetdbl(fin);
- wpt->longitude = gbfgetdbl(fin);
- wpt->altitude = gbfgetdbl(fin);
-
- gbfseek(fin, 36, SEEK_CUR); /* skip unknown 36 bytes */
-
- wpt->notes = read_str(fin);
- wpt->description = read_str(fin);
- (void) gbfgetint16(fin);
-
- waypt_add(wpt);
- }
- return;
- }
-
- int32_t wcount = gbfgetint32(fin);
- if (wcount == 0) {
- return;
- }
-
- datum = read_datum(fin);
-
- while (wcount > 0) {
- wcount--;
-
- auto* wpt = new Waypoint;
-
- wpt->latitude = gbfgetdbl(fin);
- wpt->longitude = gbfgetdbl(fin);
- wpt->altitude = gbfgetdbl(fin);
-
- convert_datum(wpt, datum);
-
- int32_t namect = gbfgetint32(fin);
-
- // variants of shortname
-
- for (int32_t i = 0; i < namect; i++) {
- auto name = read_str(fin);
- if (!name.isEmpty()) {
- switch (i) {
- case 0:
- wpt->description = name;
- break;
- case 1:
- wpt->shortname = name;
- break;
- }
- }
- }
-
- waypt_add(wpt);
- }
-}
-
-
-#if !ZLIB_INHIBITED
-
-static int
-inflate_buff(const char* buff, const size_t size, char** out_buff)
-{
- z_stream strm;
- char out[DEFLATE_BUFF_SIZE];
- char* cout = nullptr;
- uint32_t bytes = 0;
-
- strm.zalloc = Z_NULL;
- strm.zfree = Z_NULL;
- strm.opaque = Z_NULL;
- strm.avail_in = 0;
- strm.next_in = Z_NULL;
-
- int res = inflateInit(&strm);
- if (res != Z_OK) {
- return res;
- }
-
- strm.avail_in = size;
- strm.next_in = (Bytef*)buff;
-
- do {
- strm.avail_out = DEFLATE_BUFF_SIZE;
- strm.next_out = (Bytef*)out;
- res = inflate(&strm, Z_NO_FLUSH);
-
- switch (res) {
- case Z_NEED_DICT:
- res = Z_DATA_ERROR;
- [[fallthrough]];
- case Z_DATA_ERROR:
- case Z_MEM_ERROR:
- (void)inflateEnd(&strm);
- return res;
- }
- uint32_t have = DEFLATE_BUFF_SIZE - strm.avail_out;
- if (have > 0) {
- cout = (char*) xrealloc(cout, bytes + have);
- memcpy(cout+bytes, out, have);
- bytes+=have;
- }
- } while (strm.avail_out == 0);
-
- *out_buff = cout;
- return res;
-}
-
-
-static void
-read_CXMLSafe()
-{
- char* xmlstr = nullptr;
-
- xmlbin = nullptr;
- xmlbinsize = 0;
-
- xml_init(fin->name, tlog3a_xgcb_map, nullptr);
- xml_read();
- xml_deinit();
-
- if (xmlbin != nullptr) {
- inflate_buff(xmlbin, xmlbinsize, &xmlstr);
- xfree(xmlbin);
-
- xml_init(nullptr, tlog3b_xgcb_map, nullptr);
- xml_readstring(xmlstr);
- xml_deinit();
-
- xfree(xmlstr);
- }
-}
-
-#endif
-
-static void
-read_XML()
-{
- xml_init(fin->name, tlog3b_xgcb_map, nullptr);
- xml_read();
- xml_deinit();
-}
-
-/*******************************************************************************
-* %%% global callbacks called by gpsbabel main process %%% *
-*******************************************************************************/
-
-static void
-dmtlog_rd_init(const QString& fname)
-{
- fin = gbfopen_le(fname, "rb", MYNAME);
-
- xmlbin = nullptr;
- xmltrk = nullptr;
- xmlwpt = nullptr;
- xmlgrid = QString();
-}
-
-static void
-dmtlog_rd_deinit()
-{
- gbfclose(fin);
-}
-
-static void
-dmtlog_read()
-{
- switch (gbfgetuint32(fin)) {
-
- case 0x4FFFF:
- read_CTrackFile(4);
- break;
-
- case 0x8FFFF:
- read_CTrackFile(8);
- break;
-
- case 0x4d58433c:
-#if !ZLIB_INHIBITED
- read_CXMLSafe();
-#else
- fatal(MYNAME ": Zlib was not included in this build.\n");
-#endif
- break;
- case 0x7254433c:
- read_XML();
- break;
-
- default:
- fatal(MYNAME ": Unknown or unsupported file type.\n");
- }
-}
-
-static void
-dmtlog_wr_init(const QString& fname)
-{
- fout = gbfopen_le(fname, "wb", MYNAME);
-}
-
-static void
-dmtlog_wr_deinit()
-{
- gbfclose(fout);
-}
-
-static void
-write_header(const route_head* trk)
-{
- const char ZERO = '\0';
-
- header_written = 1;
-
- int count = 0;
- if (trk != nullptr) {
- count = trk->rte_waypt_ct();
- }
- if (!trk || trk->rte_name.isEmpty()) {
- write_str("Name", fout);
- } else {
- write_str(trk->rte_name, fout);
- }
-
- // This fails for internationalization, but as this text is in the
- // file itself, it shouldn't be localized.
- QString cout = QString::number(count) + " trackpoints and " +
- QString::number(waypt_count()) + " waypoints";
- write_str(cout, fout);
-
- for (int i = 3; i <= 8; i++) {
- gbfputc(ZERO, fout);
- }
- write_str("GPSBabel", fout);
- gbfputint32(count, fout);
- if (count > 0) {
- write_str("WGS84", fout);
- write_str("WGS84", fout);
- }
-}
-
-static void
-track_hdr_cb(const route_head* trk)
-{
-
- this_index++;
- if (this_index != track_index) {
- return;
- }
- write_header(trk);
-}
-
-static void
-track_wpt_cb(const Waypoint* wpt)
-{
- if (this_index != track_index) {
- return;
- }
-
- gbfputdbl(wpt->latitude, fout);
- gbfputdbl(wpt->longitude, fout);
- gbfputdbl(wpt->altitude != unknown_alt ? wpt->altitude : 0, fout);
-}
-
-static void
-wpt_cb(const Waypoint* wpt)
-{
- gbfputdbl(wpt->latitude, fout);
- gbfputdbl(wpt->longitude, fout);
- gbfputdbl(wpt->altitude != unknown_alt ? wpt->altitude : 0, fout);
-
- int names = 1;
- if (!wpt->description.isEmpty()) {
- names = 2;
- }
- gbfputint32(names, fout);
- if (names > 1) {
- write_str(wpt->description, fout);
- }
- write_str(wpt->shortname.isEmpty() ? "Name" : wpt->shortname, fout);
-}
-
-static void
-dmtlog_write()
-{
- track_index = atoi(opt_index);
- /* ... validate index */
-
- gbfputint32(0x4FFFF, fout);
- gbfputuint16(0x0A, fout);
- gbfputs("CTrackFile", fout);
- gbfputint32(4, fout);
- gbfputint32(1, fout);
- gbfputint32(0x100001, fout);
- gbfputuint32((uint32_t)gpsbabel_time, fout);
-
- header_written = 0;
- this_index = 0;
- track_disp_all(track_hdr_cb, nullptr, track_wpt_cb);
- if (!header_written) {
- write_header(nullptr);
- }
- gbfputint32(waypt_count(), fout);
- if (waypt_count() > 0) {
- write_str("WGS84", fout);
- write_str("WGS84", fout);
- waypt_disp_all(wpt_cb);
- }
-}
-
-/**************************************************************************/
-
-ff_vecs_t dmtlog_vecs = {
- ff_type_file,
- {
- (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
- (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
- ff_cap_none /* routes */
- },
- dmtlog_rd_init,
- dmtlog_wr_init,
- dmtlog_rd_deinit,
- dmtlog_wr_deinit,
- dmtlog_read,
- dmtlog_write,
- nullptr,
- &dmtlog_args,
- CET_CHARSET_ASCII, 0
- , NULL_POS_OPS
-};
-
-/**************************************************************************/
<file>style/arc.style</file>
<file>style/cambridge.style</file>
<file>style/csv.style</file>
- <file>style/cup.style</file>
<file>style/custom.style</file>
- <file>style/dna.style</file>
<file>style/garmin301.style</file>
<file>style/garmin_g1000.style</file>
<file>style/garmin_poi.style</file>
<file>style/iblue747.style</file>
<file>style/iblue757.style</file>
<file>style/land_air_sea.style</file>
- <file>style/navigonwpt.style</file>
- <file>style/nima.style</file>
<file>style/openoffice.style</file>
- <file>style/ricoh.style</file>
- <file>style/s_and_t.style</file>
<file>style/tabsep.style</file>
- <file>style/tomtom_asc.style</file>
- <file>style/tomtom_itn_places.style</file>
- <file>style/tomtom_itn.style</file>
</qresource>
</RCC>
{
return s = static_cast<state_t>(s + 1);
}
+#if 0 // No callers.
inline state_t operator++(state_t& s, int) // postfix
{
state_t ret(s);
++s;
return ret;
}
+#endif
/**
* Handle pre- or post-flight task declarations.
+++ /dev/null
-/*
- Copyright (C) 2008 Andreas Grimme, andreas.grimme(at)gmx.net
- Copyright (C) 2005 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-/*
- This module will download track data from a
-
- XAiOX iTrackU BLUETOOTH GPS-RECEIVER SiRF III
- http://www.xaiox.com/itracku_sirf3.htm
-
- Example usage::
-
- # Read from USB port, output trackpoints & waypoints in GPX format
- ./gpsbabel -i itracku -f com14 -o gpx -F out.gpx
-
- */
-#include <cmath> // for lround, round, floor
-#include <cstdarg> // for va_end, va_list, va_start
-#include <cstdio> // for fprintf, stderr, SEEK_END, fflush, sscanf, vfprintf
-#include <cstdint>
-#include <cstring> // for memcpy, strcmp, strlen, strncmp
-#include <ctime> // for gmtime
-
-#include <QByteArray> // for QByteArray
-#include <QDate> // for QDate
-#include <QDateTime> // for QDateTime
-#include <QString> // for QString
-#include <QTime> // for QTime
-#include <Qt> // for UTC
-#include <QtGlobal> // for qPrintable
-
-#include "defs.h"
-#include "gbser.h" // for gbser_read_line, gbser_write, gbser_deinit, gbser_flush, gbser_init, gbser_is_serial, gbser_read_wait, gbser_ERROR, gbser_OK
-#include "gbfile.h" // for gbfile, gbfclose, gbfopen, gbfseek, gbfread, gbfwrite, gbftell, gbsize_t
-#include "src/core/datetime.h" // for DateTime
-
-
-#define MYNAME "itracku"
-
-/* memory layout of the iTrackU data record */
-struct itracku_data_record {
- uint8_t longitude[4];
- uint8_t latitude[4];
- uint8_t creation_time[4];
- uint8_t altitude[2];
- uint8_t speed;
- uint8_t flag;
-};
-
-static int itracku_is_valid_data_record(itracku_data_record* d);
-static void to_itracku_data_record(const Waypoint* wp, itracku_data_record* d);
-static Waypoint* to_waypoint(itracku_data_record* d);
-
-/* itracku file access */
-static void itracku_file_read_data_record(gbfile* fin, itracku_data_record* d);
-static uint32_t itracku_file_read_last_time(gbfile* fin);
-static void itracku_file_read_waypts(gbfile* fin, void (*waypt_add)(Waypoint* wpt));
-static void itracku_file_write_waypt(gbfile* fout, const Waypoint* wpt);
-
-/* itracku device access */
-static const unsigned char read_update_data_command[] = { 0x60, 0xb5, 0, 0, 0, 0, 0 }; /* command string to start memory dump */
-static const int timeout = 1000; /* timeout for all read operations */
-static const char update_end_marker[] = "WP Update Over"; /* end marker for the memory dump */
-static const int update_end_marker_size = sizeof(update_end_marker);
-#if LATER
-static const int port_auto_detect_max_port = 32;
-/* Special port name for auto detect. If used, gpsbabel will try to detect the serial
-port with the itracku device automatically. */
-static const char port_auto_detect_filename[] = "auto:";
-#endif
-
-static int update_data_buffer_read_count = 0;
-static char update_data_buffer[1024];
-static char* update_data_buffer_read;
-static char* update_data_buffer_write;
-static char* update_data_buffer_end;
-
-static void itracku_device_dump_waypts(void* fd, void (*waypt_add)(Waypoint* wpt));
-static int itracku_device_update_data_init();
-static int itracku_device_update_data_read(void* buf, int len);
-static void itracku_device_write_string(const char* s);
-static const char* itracku_device_read_string();
-
-/* global variables */
-static void* fd_; /* serial fd */
-static gbfile* fin_; /* input file handle */
-static gbfile* fout_; /* output file handle */
-static gbfile* fbackup; /* backup file handle */
-static uint32_t backup_last_creation_time; /* time of last data record in backup file */
-static uint32_t new_waypoint_count; /* count of new waypoints */
-static char* port; /* serial port name */
-static char* backup_file_name; /* "backup" command option */
-static char* only_new; /* "new" command option */
-
-static void
-dbg(int l, const char* msg, ...)
-{
- va_list ap;
- va_start(ap, msg);
- if (global_opts.debug_level >= l) {
- fprintf(stderr, MYNAME ": ");
- vfprintf(stderr,msg, ap);
- fprintf(stderr, "\n");
- fflush(stderr);
- }
- va_end(ap);
-}
-
-static void
-itracku_device_write_string(const char* s)
-{
- int size = strlen(s) + 1;
- dbg(1, "write to device: %s", s);
- gbser_write(fd_, s, size);
-}
-
-static const char*
-itracku_device_read_string()
-{
- const int size = 1024;
- char* s = (char*) xmalloc(size);
- gbser_read_line(fd_, s, size, 1000, 0, 0);
- dbg(1, "read from device: %s", s);
- return s;
-}
-
-static int
-itracku_device_update_data_init()
-{
- update_data_buffer_read = update_data_buffer;
- update_data_buffer_write = update_data_buffer;
- update_data_buffer_end = update_data_buffer + sizeof(update_data_buffer);
- update_data_buffer_read_count = 0;
- dbg(1, "start memory dump");
- return 0;
-}
-
-static int
-itracku_device_update_data_read(void* buf, int len)
-{
- if (update_data_buffer_write - update_data_buffer_read >= len) {
- memcpy(buf, update_data_buffer_read, len);
- update_data_buffer_read += len;
- return len;
- }
-
- if (update_data_buffer_read + update_end_marker_size > update_data_buffer_end) {
- memcpy(update_data_buffer, update_data_buffer_read, update_data_buffer_write - update_data_buffer_read);
- update_data_buffer_write = update_data_buffer + (update_data_buffer_write - update_data_buffer_read);
- update_data_buffer_read = update_data_buffer;
- }
-
- int rc = gbser_read_wait(fd_, update_data_buffer_write, update_data_buffer_end - update_data_buffer_write, timeout);
- if (rc == gbser_ERROR) {
- return 0;
- }
-
- update_data_buffer_write += rc;
- update_data_buffer_read_count += rc;
- dbg(1, "%5d kbyte read", update_data_buffer_read_count / 1024);
-
- if (0 == strncmp(update_end_marker, update_data_buffer_write - update_end_marker_size, update_end_marker_size - 1)) {
- dbg(1, "end memory dump");
- return 0;
- }
-
- return itracku_device_update_data_read(buf, len);
-}
-
-/*
- Convert the degrees format of itracku to double.
-
- itracku stores degrees in a
- 32-bit unsigned integer. The lower
- 6 digits in 10-base notation denote the
- minutes multiplied by 10000, and digits
- 7-9 denote the degrees.
-
- To express a negative number 0x80000000 is added
- to integer.
-
- Example: the integer 49347687 is interpreted
- as
-
- ddmmmmmm
- 49347687
-
- d=49
- m=34.7687
-
- 49 degrees 34.7687 minutes
-*/
-// The argument is marked 'volatile' because of an issue in Apple's v1.5 clang.
-// Without this, the sign of 'x' mysteriously changes while in the function.
-// adding a printf inside branches not taken changes the behaviour. Very
-// mysterious, but not worth tracking down at this time. When xcode 4 comes
-// along (or anyone really cares about mega performance of this fairly obscure
-// target, we should revisit this.
-static double
-deg_min_to_deg(volatile uint32_t x)
-{
- double sign;
- // determine the sign
- if (x > 0x80000000) {
- sign = -1.0;
- x -= 0x80000000;
- } else {
- sign = 1.0;
- }
-
- uint32_t sep = 1000000;
-
- // extract degrees
- uint32_t d = (unsigned int) x / (unsigned int) sep;
- // extract (minutes * 10000)
- uint32_t m10000 = x - d * sep;
-
- // convert minutes and degrees to a double
- return sign * ((double)d + ((double)m10000) / 600000.0);
-}
-
-/*
- Convert degrees to the degrees format of itracku.
-*/
-static uint32_t
-deg_to_deg_min(double x)
-{
- int32_t sign;
-
- // determine sign
- if (x >= 0) {
- sign = 1;
- } else {
- sign = -1;
- x = -x;
- }
-
- // integer degrees
- double d = floor(x);
-
- // fractional part
- double f = x - d;
-
- return
- (uint32_t)d * 1000000 + // multiply integer degrees to shift it to the right digits.
- (uint32_t)round((f * 600000.0)) + // multiply fractional part to convert to minutes and to to shift it to the right digits.
- ((sign > 0) ? 0 : 0x80000000); // add 0x80000000 for negative degrees
-}
-
-/*
- Convert the itracku time format to time_t.
-*/
-static QDateTime
-decode_itracku_time(uint32_t date)
-{
- int seconds = date & 63;
- int minutes = (date >> 6) & 63;
- int hours = (date >> 12) & 31;
- QTime qtime(hours, minutes, seconds);
-
- int day = (date >> 17) & 31;
- int month = ((date >> 22) & 15);
- int year = ((date >> 26) & 63) + 2000;
- QDate qdate(year, month, day);
-
- return QDateTime(qdate, qtime, Qt::UTC);
-}
-
-/*
- Convert time_t to the itracku time format.
-*/
-static uint32_t
-encode_itracku_time(time_t time)
-{
- struct tm* t = gmtime(&time);
- return
- (t->tm_sec) +
- (t->tm_min << 6) +
- (t->tm_hour << 12) +
- (t->tm_mday << 17) +
- ((t->tm_mon + 1) << 22) +
- ((t->tm_year - 100) << 26);
-}
-
-/*
- Converts a itracku waypoint record to a gpsbabel waypoint.
-*/
-static Waypoint*
-to_waypoint(itracku_data_record* d)
-{
- auto* wp = new Waypoint;
- wp->longitude = deg_min_to_deg(le_read32(d->longitude));
- wp->latitude = deg_min_to_deg(le_read32(d->latitude));
- wp->SetCreationTime(decode_itracku_time(le_read32(d->creation_time)));
- wp->speed = KNOTS_TO_MPS((float)d->speed);
- wp->wpt_flags.speed = 1;
- wp->altitude = le_read16(d->altitude);
- return wp;
-}
-
-static void
-to_itracku_data_record(const Waypoint* wp, itracku_data_record* d)
-{
- le_write32(d->longitude, deg_to_deg_min(wp->longitude));
- le_write32(d->latitude, deg_to_deg_min(wp->latitude));
- le_write32(d->creation_time, encode_itracku_time(wp->creation_time.toTime_t()));
- d->speed = round(MPS_TO_KNOTS(wp->speed));
- le_write16(d->altitude, wp->altitude);
- d->flag = 0xff;
-}
-
-/*
- Tries to initialize an itracku device attached to
- serial port fd. fd must already be opened.
-
- Returns gbser_OK if the initialization is successful, a
- non-zero integer otherwise.
-*/
-static int
-init_device()
-{
- int rc;
- // verify that we have a MTK based logger...
- dbg(1, "verifying device on port %s", port);
-
- itracku_device_write_string("WP AP-Exit");
- gbser_flush(fd_);
- itracku_device_write_string("W'P Camera Detect");
- const char* greeting = itracku_device_read_string();
-
- if (0 == strcmp(greeting , "WP GPS+BT")) {
- dbg(1, "device recognised on port %s", port);
- rc = gbser_OK;
- } else {
- dbg(1, "device not recognised on port %s", port);
- rc = gbser_ERROR;
- }
- xfree((void*)greeting);
- return rc;
-}
-
-// Any arg in this list will appear in command line help and will be
-// populated for you.
-// Values for ARGTYPE_xxx can be found in defs.h and are used to
-// select the type of option.
-static
-QVector<arglist_t> itracku_args = {
- { "backup", &backup_file_name, "Appends the input to a backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
- { "new", &only_new, "Only waypoints that are not the backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
-// "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
-};
-
-/*******************************************************************************
-* %%% global callbacks called by gpsbabel main process %%% *
-*******************************************************************************/
-
-static void
-itracku_rd_init_common(const QString&)
-{
- new_waypoint_count = 0;
-
- if (backup_file_name != nullptr) {
- fbackup = gbfopen(backup_file_name, "a+", MYNAME);
- backup_last_creation_time = itracku_file_read_last_time(fbackup);
- gbfseek(fbackup, 0, SEEK_END);
- } else {
- fbackup = nullptr;
- backup_last_creation_time = 0;
- }
-}
-
-static void
-itracku_rd_ser_init(const QString& fname)
-{
-#if LATER
- if (0 == strcmp(qPrintable(fname), port_auto_detect_filename)) {
- dbg(1, "auto detecting port for iTrackU device");
- for (int i=1; !fd_ && i<port_auto_detect_max_port; ++i) {
- xasprintf(&port, "com%d", i);
- if (!gbser_is_serial(port)) {
- break;
- }
- dbg(1, "trying port %s", port);
- if ((fd_ = gbser_init(port)) == NULL) {
- dbg(1, "port %s not available.", port);
- continue;
- }
-
- if (gbser_OK == init_device()) {
- break;
- }
-
- gbser_deinit(fd_);
- fd_ = NULL;
- xfree(port);
- }
- for (int i=0; !fd_ && i<port_auto_detect_max_port; ++i) {
- xasprintf(&port, "/dev/ttyUSB%d", i);
- if (!gbser_is_serial(port)) {
- break;
- }
- dbg(1, "trying port %s", port);
- if ((fd_ = gbser_init(port)) == NULL) {
- dbg(1, "port %s not available.", port);
- continue;
- }
-
- if (gbser_OK == init_device()) {
- break;
- }
-
- gbser_deinit(fd_);
- fd_ = NULL;
- xfree(port);
- }
- if (fd_ == NULL) {
- fatal(MYNAME ": could not find device");
- }
- } else
-#endif
- {
-
- if (gbser_is_serial(qPrintable(fname))) {
- port = xstrdup(qPrintable(fname));
-
- dbg(1, "opening port %s", qPrintable(fname));
- if ((fd_ = gbser_init(port)) == nullptr) {
- fatal(MYNAME ": can't initialise port \"%s\"", port);
- }
-
- if (gbser_OK != init_device()) {
- fatal(MYNAME ": can't initialise device on port \"%s\"", port);
- }
- } else {
- fatal(MYNAME ": \"%s\" is not a valid serial port", qPrintable(fname));
- }
- }
-
- itracku_rd_init_common(fname);
-}
-
-static void
-itracku_rd_init(const QString& fname)
-{
- fin_ = gbfopen(fname, "r", MYNAME);
- itracku_rd_init_common(fname);
-}
-
-static void
-itracku_rd_deinit()
-{
- dbg(1, "%d new waypoints", new_waypoint_count);
- if (fd_) {
- dbg(3, "closing port %s", port);
- gbser_deinit(fd_);
- fd_ = nullptr;
- xfree(port);
- port = nullptr;
- }
- if (fin_) {
- gbfclose(fin_);
- fin_ = nullptr;
- }
- if (fbackup) {
- gbfclose(fbackup);
- fbackup = nullptr;
- }
-}
-
-/* Returns true if the waypoint is new, i.e. if it is not already in the
-backup file. */
-static int
-import_data_record(itracku_data_record* d)
-{
- int result = 0;
-
- if (!itracku_is_valid_data_record(d)) {
- result = 0;
- } else {
- if (fbackup) {
- if ((uint32_t)le_read32(d->creation_time) > backup_last_creation_time) {
- backup_last_creation_time = le_read32(d->creation_time);
- gbfwrite(d, sizeof(*d), 1, fbackup);
- result = -1;
- } else {
- result = (only_new == nullptr);
- }
- } else {
- result = -1;
- }
- }
- if (result) {
- ++new_waypoint_count;
- }
- return result;
-}
-
-static int
-itracku_is_valid_data_record(itracku_data_record* d)
-{
- return !(le_read32(d->longitude) == -1);
-}
-
-static void
-itracku_device_dump_waypts(void* fd, void (*waypt_add)(Waypoint*))
-{
- itracku_data_record d;
-
- dbg(1, "reading memory");
- gbser_write(fd, read_update_data_command, sizeof(read_update_data_command));
-
- itracku_device_update_data_init();
-
- while (itracku_device_update_data_read(&d, sizeof(d))) {
- if (itracku_is_valid_data_record(&d)) {
- if (import_data_record(&d)) {
- waypt_add(to_waypoint(&d));
- }
- }
- }
-}
-
-static void
-itracku_file_read_data_record(gbfile* fin, itracku_data_record* d)
-{
- gbfread(d, sizeof(*d), 1, fin);
-}
-
-static uint32_t
-itracku_file_read_last_time(gbfile* fin)
-{
- itracku_data_record d;
- gbsize_t s = sizeof(itracku_data_record);
- gbfseek(fin, 0, SEEK_END);
- if (gbftell(fin) < s) {
- return 0;
- }
- gbfseek(fin, -(int)s, SEEK_END);
- itracku_file_read_data_record(fin, &d);
- return (uint32_t) le_read32(d.creation_time);
-}
-
-static void
-itracku_file_read_waypts(gbfile* fin, void (*waypt_add)(Waypoint*))
-{
- itracku_data_record d;
-
- while (gbfread(&d, sizeof(d), 1, fin)) {
- if (le_read32(d.longitude) == -1) {
- continue;
- }
- if (import_data_record(&d)) {
- waypt_add(to_waypoint(&d));
- }
- }
-}
-
-static void
-itracku_file_write_waypt(gbfile* fout, const Waypoint* wpt)
-{
- itracku_data_record d;
- to_itracku_data_record(wpt, &d);
- gbfwrite(&d, sizeof(d), 1, fout);
-}
-
-static void
-itracku_waypt_input(void (*waypt_add)(Waypoint*))
-{
- if (fd_) {
- itracku_device_dump_waypts(fd_, waypt_add);
- } else {
- itracku_file_read_waypts(fin_, waypt_add);
- }
-}
-
-static void
-itracku_read_waypt()
-{
- itracku_waypt_input(&waypt_add);
-}
-
-static route_head* itracku_read_trk_track;
-
-static void
-itracku_read_trk_waypt_add(Waypoint* wpt)
-{
- track_add_wpt(itracku_read_trk_track, wpt);
-}
-
-static void
-itracku_read_trk()
-{
- itracku_read_trk_track = new route_head;
- track_add_head(itracku_read_trk_track);
- itracku_waypt_input(&itracku_read_trk_waypt_add);
-}
-
-static void
-itracku_read()
-{
- switch (global_opts.objective) {
- case wptdata:
- case unknown_gpsdata:
- itracku_read_waypt();
- break;
- case trkdata:
- itracku_read_trk();
- break;
- case rtedata:
- fatal(MYNAME ": reading routes is not supported.\n");
- break;
- case posndata:
- break;
- }
-}
-
-static void
-itracku_wr_init(const QString& fname)
-{
- fout_ = gbfopen(fname, "w", MYNAME);
-}
-
-static void
-itracku_wr_deinit()
-{
- gbfclose(fout_);
-}
-
-static void
-itracku_output_waypoint(const Waypoint* wp)
-{
- itracku_file_write_waypt(fout_, wp);
-}
-
-static void
-itracku_write()
-{
- waypt_disp_all(itracku_output_waypoint);
-}
-
-static void
-itracku_rt_init(const QString& fname)
-{
- itracku_rd_ser_init(fname);
- itracku_device_write_string("WP AP-Exit");
-}
-
-static void
-nmea_set_waypoint_time(Waypoint* wpt, struct tm* time, double fsec)
-{
- if (time->tm_year == 0) {
- wpt->SetCreationTime(((((time_t)time->tm_hour * 60) + time->tm_min) * 60) + time->tm_sec, lround(1000.0 * fsec));
- if (wpt->wpt_flags.fmt_use == 0) {
- wpt->wpt_flags.fmt_use = 1;
- }
- } else {
- wpt->SetCreationTime(mkgmtime(time), lround(1000.0 * fsec));
- if (wpt->wpt_flags.fmt_use != 0) {
- wpt->wpt_flags.fmt_use = 0;
- }
- }
-}
-
-static Waypoint*
-gprmc_parse(char* ibuf)
-{
- double latdeg, lngdeg;
- char lngdir, latdir;
- double hms;
- char fix;
- unsigned int dmy;
- double speed,course;
- struct tm tm;
-
- int rc = sscanf(ibuf,"$GPRMC,%lf,%c,%lf,%c,%lf,%c,%lf,%lf,%u",
- &hms, &fix, &latdeg, &latdir,
- &lngdeg, &lngdir,
- &speed, &course, &dmy);
-
- if (rc == 0) {
- return nullptr;
- }
-
- double fsec = hms - (int)hms;
-
- tm.tm_sec = (long) hms % 100;
- hms = hms / 100;
- tm.tm_min = (long) hms % 100;
- hms = hms / 100;
- tm.tm_hour = (long) hms % 100;
-
- tm.tm_year = dmy % 100 + 100;
- dmy = dmy / 100;
- tm.tm_mon = dmy % 100 - 1;
- dmy = dmy / 100;
- tm.tm_mday = dmy;
-
- auto* waypt = new Waypoint;
-
- WAYPT_SET(waypt, speed, KNOTS_TO_MPS(speed));
-
- WAYPT_SET(waypt, course, course);
-
- nmea_set_waypoint_time(waypt, &tm, fsec);
-
- if (latdir == 'S') {
- latdeg = -latdeg;
- }
- waypt->latitude = ddmm2degrees(latdeg);
-
- if (lngdir == 'W') {
- lngdeg = -lngdeg;
- }
- waypt->longitude = ddmm2degrees(lngdeg);
-
- return waypt;
-}
-
-/*
- TODO: this function should rather call code from
- nmea.c instead of using a local copy of
- gprmc_parse
-
- andreas.grimme@gmx.net
-*/
-static Waypoint*
-itracku_rt_position(posn_status*)
-{
- char line[1024];
- while (true) {
- gbser_read_line(fd_, line, sizeof(line), 5000, 13, 10);
- dbg(1, line);
- Waypoint* wpt = gprmc_parse(line);
- if (wpt) {
- return wpt;
- }
- }
-}
-
-static void
-itracku_rt_deinit()
-{
- itracku_rd_deinit();
-}
-
-/**************************************************************************/
-
-
-ff_vecs_t itracku_vecs = {
- ff_type_serial,
- {
- ff_cap_read /* waypoints */,
- ff_cap_read /* tracks */,
- ff_cap_none /* routes */
- },
- itracku_rd_ser_init,
- nullptr,
- itracku_rd_deinit,
- nullptr,
- itracku_read,
- nullptr,
- nullptr,
- &itracku_args,
- CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
- /* not fixed, can be changed through command line parameter */
- { itracku_rt_init, itracku_rt_position, itracku_rt_deinit, nullptr, nullptr, nullptr }
-};
-
-ff_vecs_t itracku_fvecs = {
- ff_type_file,
- {
- (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
- (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
- ff_cap_none /* routes */
- },
- itracku_rd_init,
- itracku_wr_init,
- itracku_rd_deinit,
- itracku_wr_deinit,
- itracku_read,
- itracku_write,
- nullptr,
- &itracku_args,
- CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
- /* not fixed, can be changed through command line parameter */
- { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
-};
-
-
-/**************************************************************************/
+++ /dev/null
-/*
-
- Support for Navitel binary tracks (.bin),
- copyright (C) 2008 Olaf.Klein@gpsbabel.org.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-#include "defs.h"
-#include "gbfile.h"
-#include "jeeps/gpsmath.h"
-
-#define MYNAME "navitel"
-
-static gbfile* fin, *fout;
-static char new_track;
-static int trkpts;
-
-/*******************************************************************************
-* %%% global callbacks called by gpsbabel main process %%% *
-*******************************************************************************/
-
-static void
-navitel_rd_init(const QString& fname)
-{
- fin = gbfopen(fname, "rb", MYNAME);
-}
-
-static void
-navitel_rd_deinit()
-{
- gbfclose(fin);
-}
-
-static void
-navitel_read_track()
-{
- route_head* trk = nullptr;
-
- int points = gbfgetint32(fin);
- (void) gbfgetint32(fin); /* unknown */
-
- for (int i = 0; i < points; i++) {
- int lon = gbfgetint32(fin);
- int lat = gbfgetint32(fin);
-
- auto* wpt = new Waypoint;
- wpt->latitude = GPS_Math_Semi_To_Deg(lat & 0x7FFFFFFF);
- wpt->longitude = GPS_Math_Semi_To_Deg(lon);
-
- if ((lat >> 31) || (trk == nullptr)) {
- trk = new route_head;
- track_add_head(trk);
- }
- track_add_wpt(trk, wpt);
- }
-}
-
-static void
-navitel_wr_init(const QString& fname)
-{
- fout = gbfopen(fname, "wb", MYNAME);
-}
-
-static void
-navitel_wr_deinit()
-{
- gbfclose(fout);
-}
-
-static void
-navitel_enum_trkpts(const Waypoint*)
-{
- trkpts++;
-}
-
-static void
-navitel_disp_trk_head(const route_head*)
-{
- new_track = 1;
-}
-
-static void
-navitel_disp_trkpts(const Waypoint* wpt)
-{
- int lat = GPS_Math_Deg_To_Semi(wpt->latitude);
- int lon = GPS_Math_Deg_To_Semi(wpt->longitude);
-
- if (new_track) {
- lat |= (1 << 31);
- new_track = 0;
- }
-
- gbfputint32(lon, fout);
- gbfputint32(lat, fout);
-}
-
-static void
-navitel_write_track()
-{
- trkpts = 0;
- track_disp_all(nullptr, nullptr, navitel_enum_trkpts);
- if (trkpts > 10000) {
- trkpts = 10000;
- warning(MYNAME ": Can store only 10000 points per file!\n");
- }
-
- gbfputint32(trkpts, fout);
- gbfputint32(1, fout); /* ? */
- track_disp_all(navitel_disp_trk_head, nullptr, navitel_disp_trkpts);
-}
-
-/**************************************************************************/
-
-ff_vecs_t navitel_trk_vecs = {
- ff_type_file,
- {
- ff_cap_none /* waypoints */,
- (ff_cap)(ff_cap_read | ff_cap_write) /* tracks */,
- ff_cap_none /* routes */
- },
- navitel_rd_init,
- navitel_wr_init,
- navitel_rd_deinit,
- navitel_wr_deinit,
- navitel_read_track,
- navitel_write_track,
- nullptr,
- nullptr,
- CET_CHARSET_UTF8, 1 /* Nothing to convert */
- , NULL_POS_OPS
-};
-
-/**************************************************************************/
+++ /dev/null
-/*
-
- Support for Raymarine Waypoint File (.rwf).
-
- Copyright (C) 2006,2007 Olaf Klein, o.b.klein@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-/*
- Known format limits:
-
- Waypoint name: max. 16 characters
- Route name: max. 16 characters
- Routes: max. 50 waypoints per route
- ???: the character set may be only a subset of std. ASCII
-
- History:
-
- 2006/10/30: Initial release (not yet in GPSBabel source tree)
- 2006/11/08:
- 2007/03/17: Remove GUIDs from writer (not really valid)
- Fix "PredictedTwa" output
- Initialize location with "My Waypoints"
- Change default value for RcCount and RelSet (now 0)
- 2007/04/18: Limit route names also to 16 characters
- Bug-fix - add missing comma (write_route_wpt_cb/items)
- Change line feeds to fixed CRLF
- Sort waypoints by name (not really needed, but nice)
- Add some MapSource icon names to icon mappings
- Remove unused id from icon table
-*/
-
-#include "defs.h"
-#include "csv_util.h"
-#include "inifile.h"
-
-#include <QString>
-#include <cctype>
-#include <cstdio>
-#include <cstdlib>
-
-static inifile_t* fin;
-static gbfile* fout;
-static Waypoint** waypt_table;
-static short_handle hshort_wpt, hshort_rte;
-static int waypt_table_sz, waypt_table_ct;
-static int rte_index, rte_wpt_index;
-static char* opt_location;
-
-#define MYNAME "raymarine"
-
-static
-QVector<arglist_t> raymarine_args = {
- { "location", &opt_location, "Default location", "My Waypoints", ARGTYPE_STRING, ARG_NOMINMAX , nullptr},
-};
-
-/* from csv_util.c: convert excel time (days since 1900) to time_t and back again */
-
-#define EXCEL_TO_TIMET(a) ((a - 25569.0) * 86400.0)
-#define TIMET_TO_EXCEL(a) ((a / 86400.0) + 25569.0)
-
-#define LINE_FEED "\r\n"
-
-/* Bitmaps */
-
-struct raymarine_symbol_mapping_t {
- const char* name;
- const char* mps_name;
-};
-
-static const raymarine_symbol_mapping_t raymarine_symbols[] = {
- { /* 0 */ "Unknown Symbol 0", nullptr },
- { /* 1 */ "Unknown Symbol 1", nullptr },
- { /* 2 */ "Unknown Symbol 2", nullptr },
- { /* 3 */ "Red Square", nullptr },
- { /* 4 */ "Big Fish", nullptr },
- { /* 5 */ "Anchor", nullptr },
- { /* 6 */ "Smiley", "Contact, Smiley" },
- { /* 7 */ "Sad", nullptr },
- { /* 8 */ "Red Button", "Navaid, Red" },
- { /* 9 */ "Sailfish", nullptr },
- { /* 10 */ "Danger", "Skull and Crossbones" },
- { /* 11 */ "Attention", nullptr },
- { /* 12 */ "Black Square", nullptr },
- { /* 13 */ "Intl. Dive Flag", "Diver Down Flag 2" },
- { /* 14 */ "Vessel", "Marina" },
- { /* 15 */ "Lobster", nullptr },
- { /* 16 */ "Buoy", "Buoy, White" },
- { /* 17 */ "Exclamation", nullptr },
- { /* 18 */ "Red X", nullptr },
- { /* 19 */ "Check Mark", nullptr },
- { /* 20 */ "Black Plus", nullptr },
- { /* 21 */ "Black Cross", nullptr },
- { /* 22 */ "MOB", nullptr },
- { /* 23 */ "Billfish", nullptr },
- { /* 24 */ "Bottom Mark", nullptr },
- { /* 25 */ "Circle", "Circle, Red" },
- { /* 26 */ "Diamond", "Block, Red" },
- { /* 27 */ "Diamond Quarters", "Diamond, Red" },
- { /* 28 */ "U.S. Dive Flag", "Diver Down Flag 1" },
- { /* 29 */ "Dolphin", nullptr },
- { /* 30 */ "Few Fish", nullptr },
- { /* 31 */ "Multiple Fish", nullptr },
- { /* 32 */ "Many Fish", nullptr },
- { /* 33 */ "Single Fish", nullptr },
- { /* 34 */ "Small Fish", nullptr },
- { /* 35 */ "Marker", nullptr },
- { /* 36 */ "Cocktails", "Bar" },
- { /* 37 */ "Red Box Marker", nullptr },
- { /* 38 */ "Reef", nullptr },
- { /* 39 */ "Rocks", nullptr },
- { /* 40 */ "Fish School", nullptr },
- { /* 41 */ "Seaweed", "Weed Bed" },
- { /* 42 */ "Shark", nullptr },
- { /* 43 */ "Sportfisher", nullptr },
- { /* 44 */ "Swimmer", "Swimming Area" },
- { /* 45 */ "Top Mark", nullptr },
- { /* 46 */ "Trawler", nullptr },
- { /* 47 */ "Tree", nullptr },
- { /* 48 */ "Triangle", "Triangle, Red" },
- { /* 49 */ "Wreck", "Shipwreck" }
-};
-
-#define RAYMARINE_SYMBOL_CT sizeof(raymarine_symbols) / sizeof(raymarine_symbol_mapping_t)
-#define RAYMARINE_STD_SYMBOL 3
-
-static int
-find_symbol_num(const QString& descr)
-{
- if (!descr.isNull()) {
- const raymarine_symbol_mapping_t* a = &raymarine_symbols[0];
-
- for (unsigned int i = 0; i < RAYMARINE_SYMBOL_CT; i++, a++) {
- if (descr.compare(a->name, Qt::CaseInsensitive) == 0) {
- return i;
- }
- if (a->mps_name && (descr.compare(a->mps_name, Qt::CaseInsensitive) == 0)) {
- return i;
- }
- }
- }
-
- return RAYMARINE_STD_SYMBOL;
-}
-
-/* ============================================= */
-/* %%% R A Y M A R I N E R E A D E R %%% */
-/* ============================================= */
-
-static void
-raymarine_rd_init(const QString& fname)
-{
- fin = inifile_init(fname, MYNAME);
-}
-
-static void
-raymarine_rd_done()
-{
- inifile_done(fin);
-}
-
-static void
-raymarine_read()
-{
- /* Read all waypoints */
-
- for (unsigned int ix = 0; ix < 0x3FFF; ix++) {
- char sect[10];
- QString str, name, lat, lon;
-
- /* built section identifier */
- snprintf(sect, sizeof(sect), "Wp%u", ix);
-
- /* try to read our most expected values */
- name = inifile_readstr(fin, sect, "Name");
- if (name.isNull()) {
- break;
- }
- lat = inifile_readstr(fin, sect, "Lat");
- if (lat.isNull()) {
- break;
- }
- lon = inifile_readstr(fin, sect, "Long");
- if (lon.isNull()) {
- break;
- }
-
- auto* wpt = new Waypoint;
- wpt->shortname = name;
- wpt->latitude = lat.toDouble();
- wpt->longitude = lon.toDouble();
- waypt_add(wpt);
-
- /* try to read optional values */
- str = inifile_readstr(fin, sect, "Notes");
- if (!str.isEmpty()) {
- wpt->notes = str;
- }
- str = inifile_readstr(fin, sect, "Time");
- if (!str.isEmpty()) {
- wpt->SetCreationTime(EXCEL_TO_TIMET(str.toDouble()));
- }
- str = inifile_readstr(fin, sect, "Bmp");
- if (!str.isEmpty()) {
- unsigned int symbol = str.toInt();
-
- if ((symbol < 3) || (symbol >= RAYMARINE_SYMBOL_CT)) {
- symbol = RAYMARINE_STD_SYMBOL;
- }
- wpt->icon_descr = raymarine_symbols[symbol].name;
- }
- }
-
- /* Read all routes */
-
- for (unsigned int rx = 0; rx < 0x3FFF; rx++) {
- char sect[10];
- QString name;
-
- snprintf(sect, sizeof(sect), "Rt%u", rx);
- name = inifile_readstr(fin, sect, "Name");
- if (name.isNull()) {
- break;
- }
-
- auto* rte = new route_head;
- rte->rte_name = name;
- route_add_head(rte);
-
- for (int wx = 0; wx < 0x3FFF; wx++) {
- char buff[32];
-
- snprintf(buff, sizeof(buff), "Mk%d", wx);
- QString str = inifile_readstr(fin, sect, buff);
- if (str.isEmpty()) {
- break;
- }
-
- Waypoint* wpt = find_waypt_by_name(str);
- if (wpt == nullptr)
- fatal(MYNAME ": No associated waypoint for route point %s (Route %s)!\n",
- qPrintable(str), qPrintable(rte->rte_name));
-
- route_add_wpt(rte, new Waypoint(*wpt));
- }
- }
-}
-
-/* ============================================= */
-/* %%% R A Y M A R I N E W R I T E R %%% */
-/* ============================================= */
-
-/* make waypoint shortnames unique */
-
-static char
-same_points(const Waypoint* A, const Waypoint* B)
-{
- return ( /* !!! We are case-sensitive !!! */
- (A->shortname == B->shortname) &&
- (A->latitude == B->latitude) &&
- (A->longitude == B->longitude));
-}
-
-static void
-register_waypt(const Waypoint* ref, const char)
-{
- auto* wpt = const_cast<Waypoint*>(ref);
-
- for (int i = 0; i < waypt_table_ct; i++) {
- Waypoint* cmp = waypt_table[i];
-
- if (same_points(wpt, cmp)) {
- wpt->extra_data = cmp->extra_data;
- return;
- }
- }
-
- if (waypt_table_ct >= waypt_table_sz) {
- waypt_table_sz += 32;
- if (waypt_table) {
- waypt_table = (Waypoint**) xrealloc(waypt_table, waypt_table_sz * sizeof(wpt));
- } else {
- waypt_table = (Waypoint**) xmalloc(waypt_table_sz * sizeof(wpt));
- }
- }
-
- wpt->extra_data = (void*)mkshort(hshort_wpt, CSTRc(wpt->shortname), false);
-
- waypt_table[waypt_table_ct] = wpt;
- waypt_table_ct++;
-}
-
-static void
-enum_waypt_cb(const Waypoint* wpt)
-{
- register_waypt(wpt, 0);
-}
-
-static void
-enum_rtept_cb(const Waypoint* wpt)
-{
- register_waypt(wpt, 1);
-}
-
-static int
-qsort_cb(const void* a, const void* b)
-{
- const Waypoint* wa = *(Waypoint**)a;
- const Waypoint* wb = *(Waypoint**)b;
- return wa->shortname.compare(wb->shortname);
-}
-
-// TODO: this first arg is both a global and a param. That's weird.
-static void
-write_waypoint(gbfile* fileout, const Waypoint* wpt, const int waypt_no, const char* location)
-{
- QString notes = wpt->notes;
- if (notes == nullptr) {
- notes = wpt->description;
- if (notes == nullptr) {
- notes = "";
- }
- }
- notes = csv_stringclean(notes, LINE_FEED);
- double time = wpt->creation_time.isValid() ? TIMET_TO_EXCEL(wpt->GetCreationTime().toTime_t()) : TIMET_TO_EXCEL(gpsbabel_time);
- char* name = (char*)wpt->extra_data;
-
- gbfprintf(fileout, "[Wp%d]" LINE_FEED
- "Loc=%s" LINE_FEED
- "Name=%s" LINE_FEED
- "Lat=%.15f" LINE_FEED
- "Long=%.15f" LINE_FEED,
- waypt_no, location, name, wpt->latitude, wpt->longitude
- );
- gbfprintf(fileout, "Rng=%.15f" LINE_FEED
- "Bear=%.15f" LINE_FEED
- "Bmp=%d" LINE_FEED
- "Fixed=1" LINE_FEED
- "Locked=0" LINE_FEED
- "Notes=%s" LINE_FEED,
- 0.0, 0.0,
- find_symbol_num(wpt->icon_descr),
- CSTR(notes)
- );
- gbfprintf(fileout, "Rel=" LINE_FEED
- "RelSet=0" LINE_FEED
- "RcCount=0" LINE_FEED
- "RcRadius=%.15f" LINE_FEED
- "Show=1" LINE_FEED
- "RcShow=0" LINE_FEED
- "SeaTemp=%.15f" LINE_FEED
- "Depth=%.15f" LINE_FEED
- "Time=%.10f00000" LINE_FEED,
- 0.0, -32678.0, 65535.0, time
- );
-}
-
-static void
-write_route_head_cb(const route_head* rte)
-{
- QString name = rte->rte_name;
- if (name.isEmpty()) {
- name=QString("Route%1").arg(rte_index);
- }
- name = mkshort(hshort_rte, name);
- gbfprintf(fout, "[Rt%d]" LINE_FEED
- "Name=%s" LINE_FEED
- "Visible=1" LINE_FEED,
- rte_index,
- CSTR(name)
- );
- rte_index++;
- rte_wpt_index = 0;
-}
-
-static void
-write_route_wpt_cb(const Waypoint* wpt)
-{
- static const char* items[] = {
- "Cog",
- "Eta",
- "Length",
- "PredictedDrift",
- "PredictedSet",
- "PredictedSog",
- "PredictedTime",
- "PredictedTwa",
- "PredictedTwd",
- "PredictedTws"
- };
-
- gbfprintf(fout, "Mk%d=%s" LINE_FEED, rte_wpt_index, (char*)wpt->extra_data);
- for (auto & item : items) {
- gbfprintf(fout, "%s%d=%.15f" LINE_FEED, item, rte_wpt_index, 0.0);
- }
-
- rte_wpt_index++;
-}
-
-static void
-enum_route_hdr_cb(const route_head* rte)
-{
- if (rte->rte_waypt_ct() > 50) {
- fatal(MYNAME ": Routes with more than 50 points are not supported by Raymarine!");
- }
-}
-
-static short_handle
-raymarine_new_short_handle()
-{
- short_handle res = mkshort_new_handle();
-
- setshort_length(res, 16);
- setshort_badchars(res, ",");
- setshort_mustupper(res, 0);
- setshort_mustuniq(res, 1);
- setshort_whitespace_ok(res, 1);
- setshort_repeating_whitespace_ok(res, 1);
-
- return res;
-}
-
-static void
-raymarine_wr_init(const QString& fname)
-{
- fout = gbfopen(fname, "wb", MYNAME);
-
- hshort_wpt = raymarine_new_short_handle();
- hshort_rte = raymarine_new_short_handle();
-}
-
-static void
-raymarine_wr_done()
-{
- mkshort_del_handle(&hshort_wpt);
- mkshort_del_handle(&hshort_rte);
-
- gbfclose(fout);
-}
-
-static void
-raymarine_write()
-{
- int i;
-
- waypt_table_sz = 0;
- waypt_table_ct = 0;
- waypt_table = nullptr;
-
- /* enumerate all possible waypoints */
- waypt_disp_all(enum_waypt_cb);
- route_disp_all(enum_route_hdr_cb, nullptr, enum_rtept_cb);
-
- if (waypt_table_ct == 0) {
- return;
- }
-
- qsort(waypt_table, waypt_table_ct, sizeof(*waypt_table), qsort_cb);
-
- /* write out waypoint summary */
- for (i = 0; i < waypt_table_ct; i++) {
- Waypoint* wpt = waypt_table[i];
- write_waypoint(fout, wpt, i, opt_location);
- }
-
- /* write out all routes with their waypoints */
- rte_index = 0;
- route_disp_all(write_route_head_cb, nullptr, write_route_wpt_cb);
-
- /* release local used data */
- for (i = 0; i < waypt_table_ct; i++) {
- Waypoint* wpt = waypt_table[i];
- xfree(wpt->extra_data);
- wpt->extra_data = nullptr;
- }
- xfree(waypt_table);
-}
-
-/* ================================================== */
-/* %%% M O D U L E R E G I S T R A T I O N %%% */
-/* ================================================== */
-
-ff_vecs_t raymarine_vecs = {
- ff_type_file,
- {
- (ff_cap)(ff_cap_read | ff_cap_write) /* waypoints */,
- ff_cap_none /* tracks */,
- (ff_cap)(ff_cap_read | ff_cap_write) /* routes */,
- },
- raymarine_rd_init,
- raymarine_wr_init,
- raymarine_rd_done,
- raymarine_wr_done,
- raymarine_read,
- raymarine_write,
- nullptr,
- &raymarine_args,
- CET_CHARSET_ASCII, 0 /* should we force this to 1 ? */
- , NULL_POS_OPS
-};
+++ /dev/null
-0,27.85049,-82.49305,MACDILL
-1,27.84906,-82.49258,MACDILL PK NAIL
-2,27.84604,-82.48745,BEAVER
-3,27.85049,-82.49305,CARTER
-4,27.87861,-82.58639,188 FLHD
-5,27.81962,-82.60658,BRIGHTWATER E
-6,27.82113,-82.60179,BRIGHTWATER D
-7,27.82098,-82.60052,BRIGHTWATER C
-8,27.81919,-82.59823,BRIGHTWATER B AZ MK 2
-9,27.81850,-82.59673,BRIGHTWATER B
-10,27.93168,-82.42910,BRIDGE 2
-11,27.93139,-82.42889,BRIDGE 2 RM 3
-12,27.87694,-82.58806,GANDY RM 2
-13,27.87694,-82.58806,GANDY RM 4
-14,27.93139,-82.42889,BRIDGE 2 RM 4
-15,27.93169,-82.42927,H 261 RESET
magellanx upt Magellan SD files (as for eXplorist)
magellan Magellan SD files (as for Meridian)
magellan Magellan serial protocol
-s_and_t txt Microsoft Streets and Trips 2002-2007
miniHomer MiniHomer, a skyTraq Venus 6 based logger (download tracks, waypoints and get/set POI)
garmin_xt Mobile Garmin XT Track files
mtk-bin bin MTK Logger (iBlue 747,...) Binary File Format
tpg tpg National Geographic Topo .tpg (waypoints)
tpo2 tpo National Geographic Topo 2.x .tpo
tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-navigonwpt Navigon Waypoints
navilink NaviGPS GT-11/BGT-11 Download
sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
sbn sbn NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)
-navitel_trk bin Navitel binary track (.bin)
-dna dna Navitrak DNA marker format
-nima NIMA/GNIS Geographic Names File
nmea NMEA 0183 sentences
osm osm OpenStreetMap data files
ozi OziExplorer
qstarz_bl-1000 Qstarz BL-1000
-raymarine rwf Raymarine Waypoint File (.rwf)
-ricoh log Ricoh GPS Log File
-cup cup See You flight analysis data
skytraq SkyTraq Venus based loggers (download)
skytraq-bin bin SkyTraq Venus based loggers Binary File Format
subrip srt SubRip subtitles for video mapping (.srt)
-xol xol Swiss Map 25/50/100 (.xol)
openoffice Tab delimited fields useful for OpenOffice
-teletype Teletype [ Get Jonathon Johnson to describe
text txt Textual Output
-tomtom_itn itn TomTom Itineraries (.itn)
-tomtom_itn_places itn TomTom Places Itineraries (.itn)
-tomtom_asc asc TomTom POI file (.asc)
-tomtom ov2 TomTom POI file (.ov2)
-dmtlog trl TrackLogs digital mapping (.trl)
unicsv Universal csv with field structure in first line
vcard vcf Vcard Output (for iPod)
-wintec_tes tes Wintec TES file
wbt-bin bin Wintec WBT-100/200 Binary File Format
wbt Wintec WBT-100/200 GPS Download
wbt-tk1 tk1 Wintec WBT-201/G-Rays 2 Binary File Format
-itracku XAiOX iTrackU Logger
-itracku-bin bin XAiOX iTrackU Logger Binary File Format
file magellanx upt Magellan SD files (as for eXplorist)
file magellan Magellan SD files (as for Meridian)
serial magellan Magellan serial protocol
-file s_and_t txt Microsoft Streets and Trips 2002-2007
serial miniHomer MiniHomer, a skyTraq Venus 6 based logger (download tracks, waypoints and get/set POI)
file garmin_xt Mobile Garmin XT Track files
file mtk-bin bin MTK Logger (iBlue 747,...) Binary File Format
file tpg tpg National Geographic Topo .tpg (waypoints)
file tpo2 tpo National Geographic Topo 2.x .tpo
file tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-file navigonwpt Navigon Waypoints
serial navilink NaviGPS GT-11/BGT-11 Download
file sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
file sbn sbn NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)
-file navitel_trk bin Navitel binary track (.bin)
-file dna dna Navitrak DNA marker format
-file nima NIMA/GNIS Geographic Names File
file nmea NMEA 0183 sentences
file osm osm OpenStreetMap data files
file ozi OziExplorer
file qstarz_bl-1000 Qstarz BL-1000
-file raymarine rwf Raymarine Waypoint File (.rwf)
-file ricoh log Ricoh GPS Log File
-file cup cup See You flight analysis data
serial skytraq SkyTraq Venus based loggers (download)
file skytraq-bin bin SkyTraq Venus based loggers Binary File Format
file subrip srt SubRip subtitles for video mapping (.srt)
-file xol xol Swiss Map 25/50/100 (.xol)
file openoffice Tab delimited fields useful for OpenOffice
-file teletype Teletype [ Get Jonathon Johnson to describe
file text txt Textual Output
-file tomtom_itn itn TomTom Itineraries (.itn)
-file tomtom_itn_places itn TomTom Places Itineraries (.itn)
-file tomtom_asc asc TomTom POI file (.asc)
-file tomtom ov2 TomTom POI file (.ov2)
-file dmtlog trl TrackLogs digital mapping (.trl)
file unicsv Universal csv with field structure in first line
file vcard vcf Vcard Output (for iPod)
-file wintec_tes tes Wintec TES file
file wbt-bin bin Wintec WBT-100/200 Binary File Format
serial wbt Wintec WBT-100/200 GPS Download
file wbt-tk1 tk1 Wintec WBT-201/G-Rays 2 Binary File Format
-serial itracku XAiOX iTrackU Logger
-file itracku-bin bin XAiOX iTrackU Logger Binary File Format
file rwrwrw magellanx upt Magellan SD files (as for eXplorist)
file rwrwrw magellan Magellan SD files (as for Meridian)
serial rwrwrw magellan Magellan serial protocol
-file rw---- s_and_t txt Microsoft Streets and Trips 2002-2007
serial r-r--- miniHomer MiniHomer, a skyTraq Venus 6 based logger (download tracks, waypoints and get/set POI)
file --r--- garmin_xt Mobile Garmin XT Track files
file r-r--- mtk-bin bin MTK Logger (iBlue 747,...) Binary File Format
file rw---- tpg tpg National Geographic Topo .tpg (waypoints)
file --r--- tpo2 tpo National Geographic Topo 2.x .tpo
file r-r-r- tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-file rw---- navigonwpt Navigon Waypoints
serial rwrwrw navilink NaviGPS GT-11/BGT-11 Download
file --r--- sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
file --r--- sbn sbn NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)
-file --rw-- navitel_trk bin Navitel binary track (.bin)
-file rw---- dna dna Navitrak DNA marker format
-file rw---- nima NIMA/GNIS Geographic Names File
file rwrw-- nmea NMEA 0183 sentences
file rw-wrw osm osm OpenStreetMap data files
file rwrwrw ozi OziExplorer
file r-r--- qstarz_bl-1000 Qstarz BL-1000
-file rw--rw raymarine rwf Raymarine Waypoint File (.rwf)
-file --rw-- ricoh log Ricoh GPS Log File
-file rw---- cup cup See You flight analysis data
serial r-r--- skytraq SkyTraq Venus based loggers (download)
file r-r--- skytraq-bin bin SkyTraq Venus based loggers Binary File Format
file ---w-- subrip srt SubRip subtitles for video mapping (.srt)
-file rwrw-- xol xol Swiss Map 25/50/100 (.xol)
file rw---- openoffice Tab delimited fields useful for OpenOffice
-file r----- teletype Teletype [ Get Jonathon Johnson to describe
file -w---- text txt Textual Output
-file ----rw tomtom_itn itn TomTom Itineraries (.itn)
-file ----rw tomtom_itn_places itn TomTom Places Itineraries (.itn)
-file rw---- tomtom_asc asc TomTom POI file (.asc)
-file rw---- tomtom ov2 TomTom POI file (.ov2)
-file rwrw-- dmtlog trl TrackLogs digital mapping (.trl)
file rwrwrw unicsv Universal csv with field structure in first line
file -w---- vcard vcf Vcard Output (for iPod)
-file r-r--- wintec_tes tes Wintec TES file
file --r--- wbt-bin bin Wintec WBT-100/200 Binary File Format
serial r-r--- wbt Wintec WBT-100/200 GPS Download
file --r--- wbt-tk1 tk1 Wintec WBT-201/G-Rays 2 Binary File Format
-serial r-r--- itracku XAiOX iTrackU Logger
-file rwrw-- itracku-bin bin XAiOX iTrackU Logger Binary File Format
option magellan nukewpt Delete all waypoints boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_magellan.html#fmt_magellan_o_nukewpt
-file rw---- s_and_t txt Microsoft Streets and Trips 2002-2007 xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html
-option s_and_t snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_snlen
-
-option s_and_t snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_snwhite
-
-option s_and_t snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_snupper
-
-option s_and_t snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_snunique
-
-option s_and_t urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_urlbase
-
-option s_and_t prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_prefer_shortnames
-
-option s_and_t datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_s_and_t.html#fmt_s_and_t_o_datum
-
serial r-r--- miniHomer MiniHomer, a skyTraq Venus 6 based logger (download tracks, waypoints and get/set POI) miniHomer
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_miniHomer.html
option miniHomer baud Baud rate used for download integer 115200 0 115200 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_miniHomer.html#fmt_miniHomer_o_baud
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tpo2.html
file r-r-r- tpo3 tpo National Geographic Topo 3.x/4.x .tpo tpo3
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tpo3.html
-file rw---- navigonwpt Navigon Waypoints xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html
-option navigonwpt snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_snlen
-
-option navigonwpt snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_snwhite
-
-option navigonwpt snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_snupper
-
-option navigonwpt snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_snunique
-
-option navigonwpt urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_urlbase
-
-option navigonwpt prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_prefer_shortnames
-
-option navigonwpt datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_datum
-
serial rwrwrw navilink NaviGPS GT-11/BGT-11 Download navilink
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navilink.html
option navilink nuketrk Delete all track points boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navilink.html#fmt_navilink_o_nuketrk
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_sbp.html
file --r--- sbn sbn NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn) sbn
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_sbn.html
-file --rw-- navitel_trk bin Navitel binary track (.bin) navitel_trk
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navitel_trk.html
-file rw---- dna dna Navitrak DNA marker format xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html
-option dna snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_snlen
-
-option dna snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_snwhite
-
-option dna snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_snupper
-
-option dna snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_snunique
-
-option dna urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_urlbase
-
-option dna prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_prefer_shortnames
-
-option dna datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dna.html#fmt_dna_o_datum
-
-file rw---- nima NIMA/GNIS Geographic Names File xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html
-option nima snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_snlen
-
-option nima snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_snwhite
-
-option nima snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_snupper
-
-option nima snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_snunique
-
-option nima urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_urlbase
-
-option nima prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_prefer_shortnames
-
-option nima datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nima.html#fmt_nima_o_datum
-
file rwrw-- nmea NMEA 0183 sentences nmea
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nmea.html
option nmea snlen Max length of waypoint name to write integer 6 1 64 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_nmea.html#fmt_nmea_o_snlen
file r-r--- qstarz_bl-1000 Qstarz BL-1000 qstarz_bl-1000
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_qstarz_bl-1000.html
-file rw--rw raymarine rwf Raymarine Waypoint File (.rwf) raymarine
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_raymarine.html
-option raymarine location Default location string My Waypoints https://www.gpsbabel.org/WEB_DOC_DIR/fmt_raymarine.html#fmt_raymarine_o_location
-
-file --rw-- ricoh log Ricoh GPS Log File xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html
-option ricoh snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_snlen
-
-option ricoh snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_snwhite
-
-option ricoh snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_snupper
-
-option ricoh snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_snunique
-
-option ricoh urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_urlbase
-
-option ricoh prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_prefer_shortnames
-
-option ricoh datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_ricoh.html#fmt_ricoh_o_datum
-
-file rw---- cup cup See You flight analysis data xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html
-option cup snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_snlen
-
-option cup snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_snwhite
-
-option cup snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_snupper
-
-option cup snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_snunique
-
-option cup urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_urlbase
-
-option cup prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_prefer_shortnames
-
-option cup datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_cup.html#fmt_cup_o_datum
-
serial r-r--- skytraq SkyTraq Venus based loggers (download) skytraq
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_skytraq.html
option skytraq erase Erase device data after download boolean 0 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_skytraq.html#fmt_skytraq_o_erase
option subrip format Format for subtitles string %s km/h %e m\n%t %l https://www.gpsbabel.org/WEB_DOC_DIR/fmt_subrip.html#fmt_subrip_o_format
-file rwrw-- xol xol Swiss Map 25/50/100 (.xol) xol
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_xol.html
file rw---- openoffice Tab delimited fields useful for OpenOffice xcsv
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_openoffice.html
option openoffice snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_openoffice.html#fmt_openoffice_o_snlen
option openoffice datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_openoffice.html#fmt_openoffice_o_datum
-file r----- teletype Teletype [ Get Jonathon Johnson to describe teletype
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_teletype.html
file -w---- text txt Textual Output text
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_text.html
option text nosep Suppress separator lines between waypoints boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_text.html#fmt_text_o_nosep
option text splitoutput Write each waypoint in a separate file boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_text.html#fmt_text_o_splitoutput
-file ----rw tomtom_itn itn TomTom Itineraries (.itn) xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html
-option tomtom_itn snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_snlen
-
-option tomtom_itn snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_snwhite
-
-option tomtom_itn snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_snupper
-
-option tomtom_itn snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_snunique
-
-option tomtom_itn urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_urlbase
-
-option tomtom_itn prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_prefer_shortnames
-
-option tomtom_itn datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn.html#fmt_tomtom_itn_o_datum
-
-file ----rw tomtom_itn_places itn TomTom Places Itineraries (.itn) xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html
-option tomtom_itn_places snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_snlen
-
-option tomtom_itn_places snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_snwhite
-
-option tomtom_itn_places snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_snupper
-
-option tomtom_itn_places snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_snunique
-
-option tomtom_itn_places urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_urlbase
-
-option tomtom_itn_places prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_prefer_shortnames
-
-option tomtom_itn_places datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_itn_places.html#fmt_tomtom_itn_places_o_datum
-
-file rw---- tomtom_asc asc TomTom POI file (.asc) xcsv
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html
-option tomtom_asc snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_snlen
-
-option tomtom_asc snwhite Allow whitespace synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_snwhite
-
-option tomtom_asc snupper UPPERCASE synth. shortnames boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_snupper
-
-option tomtom_asc snunique Make synth. shortnames unique boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_snunique
-
-option tomtom_asc urlbase Basename prepended to URL on output string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_urlbase
-
-option tomtom_asc prefer_shortnames Use shortname instead of description boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_prefer_shortnames
-
-option tomtom_asc datum GPS datum (def. WGS 84) string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom_asc.html#fmt_tomtom_asc_o_datum
-
-file rw---- tomtom ov2 TomTom POI file (.ov2) tomtom
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tomtom.html
-file rwrw-- dmtlog trl TrackLogs digital mapping (.trl) dmtlog
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dmtlog.html
-option dmtlog index Index of track (if more than one in source) integer 1 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_dmtlog.html#fmt_dmtlog_o_index
-
file rwrwrw unicsv Universal csv with field structure in first line unicsv
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_unicsv.html
option unicsv datum GPS datum (def. WGS 84) string WGS 84 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_unicsv.html#fmt_unicsv_o_datum
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_vcard.html
option vcard encrypt Encrypt hints using ROT13 boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_vcard.html#fmt_vcard_o_encrypt
-file r-r--- wintec_tes tes Wintec TES file wintec_tes
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_wintec_tes.html
file --r--- wbt-bin bin Wintec WBT-100/200 Binary File Format wbt-bin
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_wbt-bin.html
serial r-r--- wbt Wintec WBT-100/200 GPS Download wbt
file --r--- wbt-tk1 tk1 Wintec WBT-201/G-Rays 2 Binary File Format wbt-tk1
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_wbt-tk1.html
-serial r-r--- itracku XAiOX iTrackU Logger itracku
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku.html
-option itracku backup Appends the input to a backup file string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku.html#fmt_itracku_o_backup
-
-option itracku new Only waypoints that are not the backup file string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku.html#fmt_itracku_o_new
-
-file rwrw-- itracku-bin bin XAiOX iTrackU Logger Binary File Format itracku-bin
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku-bin.html
-option itracku-bin backup Appends the input to a backup file string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku-bin.html#fmt_itracku-bin_o_backup
-
-option itracku-bin new Only waypoints that are not the backup file string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_itracku-bin.html#fmt_itracku-bin_o_new
-
baud Numeric value of bitrate (baud=4800)
noack (0/1) Suppress use of handshaking in name of speed
nukewpt (0/1) Delete all waypoints
- s_and_t Microsoft Streets and Trips 2002-2007
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
miniHomer MiniHomer, a skyTraq Venus 6 based logger (downloa
baud Baud rate used for download
dump-file Dump raw data to this file
datum Datum (default=NAD27)
tpo2 National Geographic Topo 2.x .tpo
tpo3 National Geographic Topo 3.x/4.x .tpo
- navigonwpt Navigon Waypoints
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
navilink NaviGPS GT-11/BGT-11 Download
nuketrk (0/1) Delete all track points
nukerte (0/1) Delete all routes
power_off (0/1) Command unit to power itself down
sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
sbn NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)
- navitel_trk Navitel binary track (.bin)
- dna Navitrak DNA marker format
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
- nima NIMA/GNIS Geographic Names File
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
nmea NMEA 0183 sentences
snlen Max length of waypoint name to write
gprmc (0/1) Read/write GPRMC sentences
proxunit Unit used in proximity values
codec codec to use for reading and writing strings (defa
qstarz_bl-1000 Qstarz BL-1000
- raymarine Raymarine Waypoint File (.rwf)
- location Default location
- ricoh Ricoh GPS Log File
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
- cup See You flight analysis data
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
skytraq SkyTraq Venus based loggers (download)
erase (0/1) Erase device data after download
targetlocation Set location finder target location as lat,lng
gps_time GPS time at position video_time (hhmmss[.sss], def
gps_date GPS date at position video_time (yyyymmdd, default
format Format for subtitles
- xol Swiss Map 25/50/100 (.xol)
openoffice Tab delimited fields useful for OpenOffice
snlen Max synthesized shortname length
snwhite (0/1) Allow whitespace synth. shortnames
urlbase Basename prepended to URL on output
prefer_shortnames (0/1) Use shortname instead of description
datum GPS datum (def. WGS 84)
- teletype Teletype [ Get Jonathon Johnson to describe
text Textual Output
nosep (0/1) Suppress separator lines between waypoints
encrypt (0/1) Encrypt hints using ROT13
degformat Degrees output as 'ddd', 'dmm'(default) or 'dms'
altunits Units for altitude (f)eet or (m)etres
splitoutput (0/1) Write each waypoint in a separate file
- tomtom_itn TomTom Itineraries (.itn)
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
- tomtom_itn_places TomTom Places Itineraries (.itn)
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
- tomtom_asc TomTom POI file (.asc)
- snlen Max synthesized shortname length
- snwhite (0/1) Allow whitespace synth. shortnames
- snupper (0/1) UPPERCASE synth. shortnames
- snunique (0/1) Make synth. shortnames unique
- urlbase Basename prepended to URL on output
- prefer_shortnames (0/1) Use shortname instead of description
- datum GPS datum (def. WGS 84)
- tomtom TomTom POI file (.ov2)
- dmtlog TrackLogs digital mapping (.trl)
- index Index of track (if more than one in source)
unicsv Universal csv with field structure in first line
datum GPS datum (def. WGS 84)
grid Write position using this grid.
codec codec to use for reading and writing strings (defa
vcard Vcard Output (for iPod)
encrypt (0/1) Encrypt hints using ROT13
- wintec_tes Wintec TES file
wbt-bin Wintec WBT-100/200 Binary File Format
wbt Wintec WBT-100/200 GPS Download
erase (0/1) Erase device data after download
wbt-tk1 Wintec WBT-201/G-Rays 2 Binary File Format
- itracku XAiOX iTrackU Logger
- backup Appends the input to a backup file
- new Only waypoints that are not the backup file
- itracku-bin XAiOX iTrackU Logger Binary File Format
- backup Appends the input to a backup file
- new Only waypoints that are not the backup file
Supported data filters:
arc Include Only Points Within Distance of Arc
+++ /dev/null
-No,Latitude,Longitude,Name,Altitude,Speed,Date,Time\r
-1,25.815175,-80.123443,"WPT001",31.0,0.00,2008/06/21,00:12:25\r
-2,25.815190,-80.123473,"WPT002",65534.0,0.00,2008/06/21,00:12:30\r
-3,25.815202,-80.123470,"WPT003",65535.0,1.54,2008/06/21,00:12:35\r
-4,25.815195,-80.123465,"WPT004",5.0,0.00,2008/06/21,00:12:40\r
-5,25.815202,-80.123465,"WPT005",8.0,0.00,2008/06/21,00:12:46\r
-6,25.815198,-80.123475,"WPT006",11.0,0.00,2008/06/21,00:12:51\r
-7,25.815225,-80.123487,"WPT007",12.0,2.06,2008/06/21,00:12:56\r
-8,25.815580,-80.123480,"WPT008",12.0,9.26,2008/06/21,00:13:02\r
-9,25.816107,-80.123440,"WPT009",14.0,12.86,2008/06/21,00:13:07\r
-10,25.816770,-80.123367,"WPT010",16.0,11.32,2008/06/21,00:13:13\r
-11,25.817338,-80.123267,"WPT011",14.0,12.86,2008/06/21,00:13:18\r
-12,25.817937,-80.123148,"WPT012",14.0,12.86,2008/06/21,00:13:23\r
-13,25.818677,-80.122998,"WPT013",12.0,14.40,2008/06/21,00:13:29\r
-14,25.819362,-80.122873,"WPT014",11.0,15.43,2008/06/21,00:13:34\r
-15,25.820032,-80.122755,"WPT015",11.0,13.38,2008/06/21,00:13:39\r
-16,25.820600,-80.122662,"WPT016",11.0,5.14,2008/06/21,00:13:45\r
-17,25.820787,-80.122647,"WPT017",11.0,7.20,2008/06/21,00:13:50\r
-18,25.821280,-80.122628,"WPT018",11.0,13.38,2008/06/21,00:13:55\r
-19,25.822085,-80.122590,"WPT019",13.0,14.92,2008/06/21,00:14:01\r
-20,25.822835,-80.122473,"WPT020",14.0,17.49,2008/06/21,00:14:06\r
-21,25.823638,-80.122342,"WPT021",15.0,18.01,2008/06/21,00:14:11\r
-22,25.824582,-80.122177,"WPT022",15.0,16.98,2008/06/21,00:14:17\r
-23,25.825338,-80.122013,"WPT023",14.0,16.98,2008/06/21,00:14:22\r
-24,25.826100,-80.121838,"WPT024",13.0,16.98,2008/06/21,00:14:27\r
-25,25.827030,-80.121768,"WPT025",15.0,16.98,2008/06/21,00:14:33\r
-26,25.827815,-80.121822,"WPT026",16.0,16.98,2008/06/21,00:14:38\r
-27,25.828582,-80.121958,"WPT027",17.0,16.98,2008/06/21,00:14:43\r
-28,25.829457,-80.122117,"WPT028",18.0,11.83,2008/06/21,00:14:49\r
-29,25.829632,-80.122133,"WPT029",18.0,0.00,2008/06/21,00:14:54\r
-30,25.829620,-80.122130,"WPT030",18.0,0.00,2008/06/21,00:15:00\r
-31,25.829612,-80.122128,"WPT031",18.0,0.00,2008/06/21,00:15:05\r
-32,25.829625,-80.122128,"WPT032",18.0,2.57,2008/06/21,00:15:10\r
-33,25.830033,-80.122123,"WPT033",17.0,10.80,2008/06/21,00:15:16\r
-34,25.830525,-80.122072,"WPT034",16.0,8.23,2008/06/21,00:15:21\r
-35,25.830722,-80.122043,"WPT035",15.0,0.51,2008/06/21,00:15:26\r
-36,25.830715,-80.122032,"WPT036",18.0,0.00,2008/06/21,00:15:32\r
-37,25.830708,-80.122027,"WPT037",20.0,0.00,2008/06/21,00:15:37\r
-38,25.830703,-80.122023,"WPT038",21.0,0.00,2008/06/21,00:15:42\r
-39,25.830730,-80.122020,"WPT039",21.0,3.09,2008/06/21,00:15:48\r
-40,25.831047,-80.121972,"WPT040",20.0,9.77,2008/06/21,00:15:53\r
-41,25.831587,-80.121862,"WPT041",20.0,13.38,2008/06/21,00:15:58\r
-42,25.832373,-80.121665,"WPT042",21.0,15.43,2008/06/21,00:16:04\r
-43,25.833068,-80.121407,"WPT043",19.0,15.95,2008/06/21,00:16:09\r
-44,25.833753,-80.121015,"WPT044",17.0,16.46,2008/06/21,00:16:14\r
-45,25.834625,-80.120753,"WPT045",19.0,16.46,2008/06/21,00:16:20\r
-46,25.835393,-80.120720,"WPT046",21.0,16.46,2008/06/21,00:16:25\r
-47,25.836182,-80.120743,"WPT047",20.0,17.49,2008/06/21,00:16:30\r
-48,25.837133,-80.120810,"WPT048",20.0,16.98,2008/06/21,00:16:36\r
-49,25.837895,-80.120937,"WPT049",21.0,15.95,2008/06/21,00:16:41\r
-50,25.838615,-80.120967,"WPT050",21.0,15.43,2008/06/21,00:16:46\r
-51,25.839517,-80.120993,"WPT051",20.0,16.98,2008/06/21,00:16:52\r
-52,25.840183,-80.121043,"WPT052",21.0,11.32,2008/06/21,00:16:57\r
-53,25.840465,-80.121105,"WPT053",20.0,3.09,2008/06/21,00:17:02\r
-54,25.840538,-80.121128,"WPT054",21.0,0.00,2008/06/21,00:17:08\r
-55,25.840542,-80.121132,"WPT055",21.0,0.51,2008/06/21,00:17:13\r
-56,25.840543,-80.121135,"WPT056",21.0,0.00,2008/06/21,00:17:19\r
-57,25.840537,-80.121135,"WPT057",21.0,0.00,2008/06/21,00:17:24\r
-58,25.840680,-80.121187,"WPT058",21.0,6.69,2008/06/21,00:17:29\r
-59,25.841197,-80.121357,"WPT059",19.0,10.80,2008/06/21,00:17:35\r
-60,25.841712,-80.121327,"WPT060",17.0,11.32,2008/06/21,00:17:40\r
-61,25.842140,-80.120985,"WPT061",15.0,11.32,2008/06/21,00:17:45\r
-62,25.842720,-80.120683,"WPT062",15.0,11.83,2008/06/21,00:17:51\r
-63,25.843225,-80.120673,"WPT063",16.0,9.26,2008/06/21,00:17:56\r
-64,25.843687,-80.120695,"WPT064",16.0,10.80,2008/06/21,00:18:01\r
-65,25.844387,-80.120717,"WPT065",14.0,13.38,2008/06/21,00:18:07\r
-66,25.844913,-80.120473,"WPT066",15.0,11.83,2008/06/21,00:18:12\r
-67,25.845483,-80.120270,"WPT067",14.0,14.40,2008/06/21,00:18:17\r
-68,25.846302,-80.120227,"WPT068",16.0,14.40,2008/06/21,00:18:23\r
-69,25.847010,-80.120253,"WPT069",16.0,15.43,2008/06/21,00:18:28\r
-70,25.847743,-80.120265,"WPT070",15.0,15.43,2008/06/21,00:18:33\r
-71,25.848560,-80.120288,"WPT071",14.0,13.38,2008/06/21,00:18:39\r
-72,25.849240,-80.120313,"WPT072",14.0,14.92,2008/06/21,00:18:44\r
-73,25.849925,-80.120332,"WPT073",14.0,14.40,2008/06/21,00:18:49\r
-74,25.850630,-80.120352,"WPT074",13.0,11.83,2008/06/21,00:18:55\r
-75,25.851173,-80.120355,"WPT075",11.0,11.32,2008/06/21,00:19:00\r
-76,25.851717,-80.120370,"WPT076",11.0,11.83,2008/06/21,00:19:05\r
-77,25.852345,-80.120387,"WPT077",12.0,10.29,2008/06/21,00:19:11\r
-78,25.852857,-80.120397,"WPT078",12.0,12.86,2008/06/21,00:19:16\r
-79,25.853500,-80.120420,"WPT079",12.0,14.40,2008/06/21,00:19:21\r
-80,25.854257,-80.120453,"WPT080",12.0,13.38,2008/06/21,00:19:27\r
-81,25.854828,-80.120478,"WPT081",12.0,10.80,2008/06/21,00:19:32\r
-82,25.855285,-80.120493,"WPT082",12.0,7.20,2008/06/21,00:19:38\r
-83,25.855697,-80.120517,"WPT083",13.0,10.29,2008/06/21,00:19:43\r
-84,25.856223,-80.120535,"WPT084",13.0,11.32,2008/06/21,00:19:48\r
-85,25.856910,-80.120563,"WPT085",13.0,12.86,2008/06/21,00:19:54\r
-86,25.857505,-80.120668,"WPT086",13.0,13.38,2008/06/21,00:19:59\r
-87,25.858083,-80.120900,"WPT087",13.0,12.86,2008/06/21,00:20:04\r
-88,25.858753,-80.120983,"WPT088",13.0,11.32,2008/06/21,00:20:10\r
-89,25.859300,-80.120998,"WPT089",11.0,11.83,2008/06/21,00:20:15\r
-90,25.859908,-80.121022,"WPT090",10.0,14.40,2008/06/21,00:20:20\r
-91,25.860740,-80.121057,"WPT091",9.0,14.92,2008/06/21,00:20:26\r
-92,25.861447,-80.121065,"WPT092",8.0,15.95,2008/06/21,00:20:31\r
-93,25.862150,-80.121082,"WPT093",8.0,14.92,2008/06/21,00:20:36\r
-94,25.862920,-80.121095,"WPT094",8.0,13.89,2008/06/21,00:20:42\r
-95,25.863587,-80.121115,"WPT095",8.0,14.40,2008/06/21,00:20:47\r
-96,25.864240,-80.121127,"WPT096",8.0,13.89,2008/06/21,00:20:52\r
-97,25.865053,-80.121143,"WPT097",8.0,15.95,2008/06/21,00:20:58\r
-98,25.865818,-80.121163,"WPT098",7.0,16.46,2008/06/21,00:21:03\r
-99,25.866565,-80.121178,"WPT099",8.0,15.95,2008/06/21,00:21:08\r
-100,25.867450,-80.121203,"WPT100",8.0,15.95,2008/06/21,00:21:14\r
-101,25.868192,-80.121223,"WPT101",8.0,15.95,2008/06/21,00:21:19\r
-102,25.868927,-80.121278,"WPT102",8.0,16.46,2008/06/21,00:21:24\r
-103,25.869803,-80.121348,"WPT103",9.0,15.95,2008/06/21,00:21:30\r
-104,25.870542,-80.121403,"WPT104",9.0,15.95,2008/06/21,00:21:35\r
-105,25.871252,-80.121462,"WPT105",9.0,15.43,2008/06/21,00:21:40\r
-106,25.872058,-80.121538,"WPT106",10.0,13.89,2008/06/21,00:21:46\r
-107,25.872688,-80.121550,"WPT107",10.0,13.38,2008/06/21,00:21:51\r
-108,25.873293,-80.121385,"WPT108",10.0,13.38,2008/06/21,00:21:56\r
-109,25.874065,-80.121417,"WPT109",10.0,14.92,2008/06/21,00:22:02\r
-110,25.874783,-80.121475,"WPT110",10.0,15.95,2008/06/21,00:22:07\r
-111,25.875667,-80.121547,"WPT111",11.0,15.95,2008/06/21,00:22:13\r
-112,25.876417,-80.121675,"WPT112",12.0,16.98,2008/06/21,00:22:18\r
-113,25.877215,-80.121772,"WPT113",10.0,17.49,2008/06/21,00:22:23\r
-114,25.878135,-80.121860,"WPT114",9.0,15.95,2008/06/21,00:22:29\r
-115,25.878850,-80.121940,"WPT115",9.0,15.43,2008/06/21,00:22:34\r
-116,25.879528,-80.122015,"WPT116",9.0,13.89,2008/06/21,00:22:39\r
-117,25.880293,-80.122090,"WPT117",9.0,13.89,2008/06/21,00:22:45\r
-118,25.880927,-80.122153,"WPT118",9.0,13.38,2008/06/21,00:22:50\r
-119,25.881528,-80.122210,"WPT119",9.0,13.38,2008/06/21,00:22:55\r
-120,25.882260,-80.122280,"WPT120",8.0,13.38,2008/06/21,00:23:01\r
-121,25.882885,-80.122338,"WPT121",8.0,13.89,2008/06/21,00:23:06\r
-122,25.883498,-80.122400,"WPT122",8.0,12.86,2008/06/21,00:23:11\r
-123,25.884210,-80.122467,"WPT123",8.0,13.38,2008/06/21,00:23:17\r
-124,25.884810,-80.122528,"WPT124",8.0,12.35,2008/06/21,00:23:22\r
-125,25.885390,-80.122587,"WPT125",9.0,13.38,2008/06/21,00:23:27\r
-126,25.886185,-80.122662,"WPT126",9.0,14.92,2008/06/21,00:23:33\r
-127,25.886795,-80.122727,"WPT127",10.0,12.35,2008/06/21,00:23:38\r
-128,25.887355,-80.122827,"WPT128",10.0,12.35,2008/06/21,00:23:43\r
-129,25.887863,-80.123232,"WPT129",10.0,9.77,2008/06/21,00:23:49\r
-130,25.888162,-80.123583,"WPT130",10.0,8.75,2008/06/21,00:23:54\r
-131,25.888552,-80.123817,"WPT131",9.0,10.29,2008/06/21,00:23:59\r
-132,25.889195,-80.123910,"WPT132",8.0,13.89,2008/06/21,00:24:05\r
-133,25.889833,-80.123945,"WPT133",8.0,12.35,2008/06/21,00:24:10\r
-134,25.890360,-80.123973,"WPT134",8.0,11.32,2008/06/21,00:24:15\r
-135,25.890962,-80.124012,"WPT135",8.0,9.77,2008/06/21,00:24:21\r
-136,25.891410,-80.124042,"WPT136",8.0,10.29,2008/06/21,00:24:26\r
-137,25.891940,-80.124072,"WPT137",8.0,12.86,2008/06/21,00:24:31\r
-138,25.892667,-80.124120,"WPT138",8.0,12.86,2008/06/21,00:24:37\r
-139,25.893248,-80.124160,"WPT139",9.0,12.35,2008/06/21,00:24:42\r
-140,25.893962,-80.124208,"WPT140",9.0,13.38,2008/06/21,00:24:48\r
-141,25.894588,-80.124248,"WPT141",9.0,13.38,2008/06/21,00:24:53\r
-142,25.895067,-80.124275,"WPT142",9.0,6.17,2008/06/21,00:24:58\r
-143,25.895232,-80.124283,"WPT143",9.0,0.00,2008/06/21,00:25:04\r
-144,25.895227,-80.124280,"WPT144",9.0,0.00,2008/06/21,00:25:09\r
-145,25.895228,-80.124277,"WPT145",9.0,0.51,2008/06/21,00:25:14\r
-146,25.895490,-80.124293,"WPT146",9.0,7.72,2008/06/21,00:25:20\r
-147,25.895950,-80.124322,"WPT147",10.0,11.32,2008/06/21,00:25:25\r
-148,25.896488,-80.124358,"WPT148",9.0,11.32,2008/06/21,00:25:30\r
-149,25.897175,-80.124413,"WPT149",9.0,13.38,2008/06/21,00:25:36\r
-150,25.897825,-80.124463,"WPT150",12.0,13.38,2008/06/21,00:25:41\r
-151,25.898510,-80.124535,"WPT151",15.0,16.46,2008/06/21,00:25:46\r
-152,25.899472,-80.124592,"WPT152",18.0,18.01,2008/06/21,00:25:52\r
-153,25.900310,-80.124642,"WPT153",18.0,18.52,2008/06/21,00:25:57\r
-154,25.901142,-80.124688,"WPT154",16.0,17.49,2008/06/21,00:26:02\r
-155,25.902122,-80.124708,"WPT155",10.0,18.01,2008/06/21,00:26:08\r
-156,25.902850,-80.124577,"WPT156",8.0,13.38,2008/06/21,00:26:13\r
-157,25.903415,-80.124358,"WPT157",8.0,12.86,2008/06/21,00:26:18\r
-158,25.904070,-80.123957,"WPT158",8.0,14.92,2008/06/21,00:26:24\r
-159,25.904680,-80.123483,"WPT159",8.0,16.98,2008/06/21,00:26:29\r
-160,25.905338,-80.123058,"WPT160",8.0,15.43,2008/06/21,00:26:34\r
-161,25.906078,-80.122783,"WPT161",8.0,13.89,2008/06/21,00:26:40\r
-162,25.906778,-80.122678,"WPT162",8.0,16.46,2008/06/21,00:26:45\r
-163,25.907557,-80.122655,"WPT163",8.0,16.98,2008/06/21,00:26:50\r
-164,25.908417,-80.122652,"WPT164",8.0,13.89,2008/06/21,00:26:56\r
-165,25.909043,-80.122650,"WPT165",8.0,13.89,2008/06/21,00:27:01\r
-166,25.909722,-80.122642,"WPT166",8.0,16.46,2008/06/21,00:27:06\r
-167,25.910690,-80.122635,"WPT167",8.0,18.01,2008/06/21,00:27:12\r
-168,25.911423,-80.122628,"WPT168",8.0,14.40,2008/06/21,00:27:17\r
-169,25.912258,-80.122622,"WPT169",9.0,15.95,2008/06/21,00:27:23\r
-170,25.912992,-80.122607,"WPT170",8.0,15.95,2008/06/21,00:27:28\r
-171,25.913708,-80.122602,"WPT171",9.0,15.43,2008/06/21,00:27:33\r
-172,25.914510,-80.122582,"WPT172",9.0,13.89,2008/06/21,00:27:39\r
-173,25.915120,-80.122565,"WPT173",9.0,12.86,2008/06/21,00:27:44\r
-174,25.915715,-80.122548,"WPT174",9.0,13.89,2008/06/21,00:27:49\r
-175,25.916517,-80.122527,"WPT175",9.0,13.89,2008/06/21,00:27:55\r
-176,25.917107,-80.122517,"WPT176",9.0,12.35,2008/06/21,00:28:00\r
-177,25.917708,-80.122502,"WPT177",9.0,13.89,2008/06/21,00:28:05\r
-178,25.918530,-80.122473,"WPT178",9.0,15.43,2008/06/21,00:28:11\r
-179,25.919223,-80.122460,"WPT179",9.0,14.40,2008/06/21,00:28:16\r
-180,25.919908,-80.122445,"WPT180",9.0,15.43,2008/06/21,00:28:21\r
-181,25.920773,-80.122420,"WPT181",9.0,15.43,2008/06/21,00:28:27\r
-182,25.921425,-80.122408,"WPT182",8.0,13.89,2008/06/21,00:28:32\r
-183,25.922050,-80.122390,"WPT183",8.0,13.38,2008/06/21,00:28:37\r
-184,25.922767,-80.122372,"WPT184",8.0,12.35,2008/06/21,00:28:43\r
-185,25.923265,-80.122353,"WPT185",8.0,8.75,2008/06/21,00:28:48\r
-186,25.923545,-80.122347,"WPT186",8.0,3.60,2008/06/21,00:28:53\r
-187,25.923698,-80.122345,"WPT187",9.0,5.14,2008/06/21,00:28:59\r
-188,25.924067,-80.122345,"WPT188",10.0,9.77,2008/06/21,00:29:04\r
-189,25.924580,-80.122347,"WPT189",11.0,12.35,2008/06/21,00:29:09\r
-190,25.925292,-80.122325,"WPT190",11.0,13.38,2008/06/21,00:29:15\r
-191,25.925912,-80.122298,"WPT191",10.0,13.38,2008/06/21,00:29:20\r
-192,25.926542,-80.122280,"WPT192",9.0,13.89,2008/06/21,00:29:25\r
-193,25.927315,-80.122262,"WPT193",9.0,13.89,2008/06/21,00:29:31\r
-194,25.927923,-80.122275,"WPT194",10.0,12.86,2008/06/21,00:29:36\r
-195,25.928637,-80.122288,"WPT195",11.0,16.98,2008/06/21,00:29:41\r
-196,25.929537,-80.122255,"WPT196",15.0,15.43,2008/06/21,00:29:47\r
-197,25.930182,-80.122230,"WPT197",16.0,12.35,2008/06/21,00:29:52\r
-198,25.930660,-80.122758,"WPT198",15.0,13.89,2008/06/21,00:29:58\r
-199,25.930665,-80.123585,"WPT199",13.0,17.49,2008/06/21,00:30:03\r
-200,25.930623,-80.124518,"WPT200",11.0,19.03,2008/06/21,00:30:08\r
-201,25.930578,-80.125668,"WPT201",10.0,18.52,2008/06/21,00:30:14\r
-202,25.930540,-80.126617,"WPT202",9.0,19.03,2008/06/21,00:30:19\r
-203,25.930495,-80.127580,"WPT203",10.0,19.55,2008/06/21,00:30:24\r
-204,25.930413,-80.128752,"WPT204",13.0,18.52,2008/06/21,00:30:30\r
-205,25.930355,-80.129698,"WPT205",18.0,19.03,2008/06/21,00:30:35\r
-206,25.930278,-80.130643,"WPT206",20.0,18.01,2008/06/21,00:30:40\r
-207,25.930167,-80.131692,"WPT207",17.0,17.49,2008/06/21,00:30:46\r
-208,25.929965,-80.132590,"WPT208",12.0,18.52,2008/06/21,00:30:51\r
-209,25.929632,-80.133435,"WPT209",9.0,18.01,2008/06/21,00:30:56\r
-210,25.929117,-80.134432,"WPT210",6.0,19.55,2008/06/21,00:31:02\r
-211,25.928667,-80.135278,"WPT211",6.0,19.03,2008/06/21,00:31:07\r
-212,25.928243,-80.136080,"WPT212",5.0,18.01,2008/06/21,00:31:12\r
-213,25.927723,-80.137042,"WPT213",5.0,19.03,2008/06/21,00:31:18\r
-214,25.927290,-80.137875,"WPT214",5.0,19.03,2008/06/21,00:31:23\r
-215,25.926887,-80.138720,"WPT215",4.0,18.52,2008/06/21,00:31:28\r
-216,25.926553,-80.139813,"WPT216",3.0,19.03,2008/06/21,00:31:34\r
-217,25.926452,-80.140767,"WPT217",4.0,19.55,2008/06/21,00:31:39\r
-218,25.926412,-80.141795,"WPT218",4.0,20.58,2008/06/21,00:31:44\r
-219,25.926375,-80.142830,"WPT219",4.0,13.38,2008/06/21,00:31:50\r
-220,25.926352,-80.143408,"WPT220",4.0,10.29,2008/06/21,00:31:55\r
-221,25.926340,-80.143797,"WPT221",4.0,2.57,2008/06/21,00:32:01\r
-222,25.926338,-80.143890,"WPT222",4.0,3.60,2008/06/21,00:32:06\r
-223,25.926322,-80.144255,"WPT223",3.0,10.29,2008/06/21,00:32:11\r
-224,25.926295,-80.144907,"WPT224",3.0,14.92,2008/06/21,00:32:16\r
-225,25.926260,-80.145877,"WPT225",4.0,15.95,2008/06/21,00:32:22\r
-226,25.926225,-80.146675,"WPT226",3.0,14.40,2008/06/21,00:32:27\r
-227,25.926207,-80.147152,"WPT227",3.0,2.06,2008/06/21,00:32:33\r
-228,25.926207,-80.147165,"WPT228",3.0,0.00,2008/06/21,00:32:38\r
-229,25.926208,-80.147160,"WPT229",3.0,0.00,2008/06/21,00:32:43\r
-230,25.926195,-80.147545,"WPT230",3.0,11.32,2008/06/21,00:32:49\r
-231,25.926158,-80.148295,"WPT231",4.0,17.49,2008/06/21,00:32:54\r
-232,25.926125,-80.149195,"WPT232",5.0,18.01,2008/06/21,00:32:59\r
-233,25.926078,-80.150333,"WPT233",4.0,19.03,2008/06/21,00:33:05\r
-234,25.926082,-80.151293,"WPT234",3.0,18.52,2008/06/21,00:33:10\r
-235,25.926138,-80.152173,"WPT235",3.0,16.46,2008/06/21,00:33:15\r
-236,25.926217,-80.153052,"WPT236",3.0,11.32,2008/06/21,00:33:21\r
-237,25.926297,-80.153497,"WPT237",4.0,5.14,2008/06/21,00:33:26\r
-238,25.926448,-80.153550,"WPT238",4.0,5.66,2008/06/21,00:33:31\r
-239,25.926967,-80.153415,"WPT239",4.0,12.86,2008/06/21,00:33:37\r
-240,25.927638,-80.153205,"WPT240",3.0,16.46,2008/06/21,00:33:42\r
-241,25.928418,-80.152957,"WPT241",3.0,18.01,2008/06/21,00:33:47\r
-242,25.929377,-80.152653,"WPT242",3.0,18.01,2008/06/21,00:33:53\r
-243,25.930188,-80.152352,"WPT243",3.0,19.03,2008/06/21,00:33:58\r
-244,25.931002,-80.151968,"WPT244",2.0,18.52,2008/06/21,00:34:03\r
-245,25.931932,-80.151647,"WPT245",3.0,15.95,2008/06/21,00:34:09\r
-246,25.932615,-80.151458,"WPT246",4.0,15.43,2008/06/21,00:34:14\r
-247,25.933242,-80.151265,"WPT247",4.0,11.32,2008/06/21,00:34:19\r
-248,25.933735,-80.151107,"WPT248",4.0,7.20,2008/06/21,00:34:25\r
-249,25.934038,-80.151010,"WPT249",4.0,8.23,2008/06/21,00:34:30\r
-250,25.934580,-80.150850,"WPT250",3.0,12.35,2008/06/21,00:34:36\r
-251,25.935153,-80.150688,"WPT251",3.0,14.40,2008/06/21,00:34:41\r
-252,25.935845,-80.150478,"WPT252",3.0,15.95,2008/06/21,00:34:46\r
-253,25.936685,-80.150210,"WPT253",3.0,16.46,2008/06/21,00:34:52\r
-254,25.937388,-80.149983,"WPT254",3.0,15.43,2008/06/21,00:34:57\r
-255,25.938067,-80.149737,"WPT255",3.0,15.43,2008/06/21,00:35:02\r
-256,25.938880,-80.149475,"WPT256",3.0,15.43,2008/06/21,00:35:08\r
-257,25.939545,-80.149263,"WPT257",3.0,15.43,2008/06/21,00:35:13\r
-258,25.940255,-80.149038,"WPT258",2.0,15.95,2008/06/21,00:35:18\r
-259,25.941065,-80.148787,"WPT259",3.0,14.92,2008/06/21,00:35:24\r
-260,25.941732,-80.148575,"WPT260",2.0,14.92,2008/06/21,00:35:29\r
-261,25.942375,-80.148373,"WPT261",3.0,13.89,2008/06/21,00:35:34\r
-262,25.943083,-80.148150,"WPT262",3.0,13.38,2008/06/21,00:35:40\r
-263,25.943697,-80.147957,"WPT263",3.0,13.89,2008/06/21,00:35:45\r
-264,25.944282,-80.147767,"WPT264",2.0,12.86,2008/06/21,00:35:50\r
-265,25.944955,-80.147542,"WPT265",2.0,12.35,2008/06/21,00:35:56\r
-266,25.945518,-80.147365,"WPT266",3.0,12.86,2008/06/21,00:36:01\r
-267,25.946022,-80.147207,"WPT267",3.0,9.26,2008/06/21,00:36:06\r
-268,25.946518,-80.147058,"WPT268",3.0,8.23,2008/06/21,00:36:12\r
-269,25.946785,-80.146980,"WPT269",3.0,4.63,2008/06/21,00:36:17\r
-270,25.946905,-80.146947,"WPT270",3.0,1.03,2008/06/21,00:36:22\r
-271,25.946925,-80.146942,"WPT271",3.0,0.00,2008/06/21,00:36:28\r
-272,25.946920,-80.146942,"WPT272",3.0,0.00,2008/06/21,00:36:33\r
-273,25.946913,-80.146942,"WPT273",3.0,0.00,2008/06/21,00:36:38\r
-274,25.946908,-80.146942,"WPT274",3.0,0.00,2008/06/21,00:36:44\r
-275,25.946903,-80.146938,"WPT275",3.0,0.00,2008/06/21,00:36:49\r
-276,25.946898,-80.146938,"WPT276",3.0,0.00,2008/06/21,00:36:55\r
-277,25.946897,-80.146938,"WPT277",3.0,0.00,2008/06/21,00:37:00\r
-278,25.946895,-80.146940,"WPT278",3.0,0.00,2008/06/21,00:37:05\r
-279,25.946895,-80.146943,"WPT279",3.0,0.00,2008/06/21,00:37:11\r
-280,25.946895,-80.146945,"WPT280",3.0,0.00,2008/06/21,00:37:16\r
-281,25.946893,-80.146947,"WPT281",3.0,0.00,2008/06/21,00:37:21\r
-282,25.946907,-80.146943,"WPT282",3.0,0.51,2008/06/21,00:37:27\r
-283,25.946918,-80.146942,"WPT283",4.0,0.00,2008/06/21,00:37:32\r
-284,25.946918,-80.146942,"WPT284",4.0,0.00,2008/06/21,00:37:37\r
-285,25.946918,-80.146943,"WPT285",4.0,0.00,2008/06/21,00:37:43\r
-286,25.946983,-80.146927,"WPT286",4.0,3.60,2008/06/21,00:37:48\r
-287,25.947283,-80.146855,"WPT287",4.0,8.75,2008/06/21,00:37:53\r
-288,25.947823,-80.146742,"WPT288",3.0,9.77,2008/06/21,00:37:59\r
-289,25.948272,-80.146660,"WPT289",4.0,10.29,2008/06/21,00:38:04\r
-290,25.948788,-80.146588,"WPT290",4.0,12.35,2008/06/21,00:38:09\r
-291,25.949512,-80.146535,"WPT291",4.0,12.86,2008/06/21,00:38:15\r
-292,25.950122,-80.146520,"WPT292",4.0,12.86,2008/06/21,00:38:20\r
-293,25.950707,-80.146527,"WPT293",4.0,11.83,2008/06/21,00:38:25\r
-294,25.951377,-80.146552,"WPT294",4.0,12.86,2008/06/21,00:38:31\r
-295,25.951972,-80.146572,"WPT295",5.0,12.35,2008/06/21,00:38:36\r
-296,25.952567,-80.146593,"WPT296",5.0,12.35,2008/06/21,00:38:41\r
-297,25.953118,-80.146610,"WPT297",6.0,6.17,2008/06/21,00:38:47\r
-298,25.953382,-80.146617,"WPT298",6.0,6.17,2008/06/21,00:38:52\r
-299,25.953602,-80.146625,"WPT299",6.0,4.12,2008/06/21,00:38:57\r
-300,25.953945,-80.146637,"WPT300",7.0,8.23,2008/06/21,00:39:03\r
-301,25.954395,-80.146645,"WPT301",6.0,10.80,2008/06/21,00:39:08\r
-302,25.954942,-80.146662,"WPT302",6.0,11.32,2008/06/21,00:39:13\r
-303,25.955540,-80.146688,"WPT303",6.0,10.29,2008/06/21,00:39:19\r
-304,25.956033,-80.146673,"WPT304",7.0,10.80,2008/06/21,00:39:24\r
-305,25.956613,-80.146695,"WPT305",8.0,9.26,2008/06/21,00:39:30\r
-306,25.956893,-80.146648,"WPT306",8.0,3.60,2008/06/21,00:39:35\r
-307,25.956915,-80.146538,"WPT307",7.0,1.54,2008/06/21,00:39:40\r
-308,25.956913,-80.146395,"WPT308",7.0,3.09,2008/06/21,00:39:46\r
-309,25.956905,-80.146210,"WPT309",7.0,3.09,2008/06/21,00:39:51\r
-310,25.956840,-80.146080,"WPT310",7.0,4.12,2008/06/21,00:39:56\r
-311,25.956578,-80.145975,"WPT311",7.0,4.63,2008/06/21,00:40:02\r
-312,25.956415,-80.145895,"WPT312",6.0,2.57,2008/06/21,00:40:07\r
-313,25.956278,-80.145792,"WPT313",5.0,5.66,2008/06/21,00:40:12\r
-314,25.955985,-80.145450,"WPT314",4.0,7.72,2008/06/21,00:40:18\r
-315,25.955727,-80.145122,"WPT315",5.0,9.26,2008/06/21,00:40:23\r
-316,25.955450,-80.144778,"WPT316",6.0,8.75,2008/06/21,00:40:28\r
-317,25.955130,-80.144370,"WPT317",7.0,8.75,2008/06/21,00:40:34\r
-318,25.954893,-80.144002,"WPT318",7.0,8.75,2008/06/21,00:40:39\r
-319,25.954665,-80.143612,"WPT319",7.0,8.75,2008/06/21,00:40:44\r
-320,25.954438,-80.143225,"WPT320",6.0,6.69,2008/06/21,00:40:50\r
-321,25.954275,-80.142912,"WPT321",4.0,7.20,2008/06/21,00:40:55\r
-322,25.954125,-80.142580,"WPT322",4.0,7.72,2008/06/21,00:41:00\r
-323,25.954007,-80.142192,"WPT323",3.0,4.12,2008/06/21,00:41:06\r
-324,25.954077,-80.142062,"WPT324",4.0,2.57,2008/06/21,00:41:11\r
-325,25.954097,-80.141885,"WPT325",3.0,3.09,2008/06/21,00:41:16\r
-326,25.954218,-80.141795,"WPT326",3.0,2.57,2008/06/21,00:41:22\r
-327,25.954332,-80.141825,"WPT327",3.0,2.57,2008/06/21,00:41:27\r
-328,25.954453,-80.141857,"WPT328",3.0,1.54,2008/06/21,00:41:32\r
-329,25.954493,-80.141865,"WPT329",3.0,0.00,2008/06/21,00:41:38\r
-330,25.954517,-80.141887,"WPT330",3.0,0.00,2008/06/21,00:41:43\r
-331,25.954517,-80.141888,"WPT331",3.0,0.00,2008/06/21,00:41:48\r
-332,25.954528,-80.141888,"WPT332",3.0,0.00,2008/06/21,00:41:54\r
-333,25.954532,-80.141888,"WPT333",3.0,0.00,2008/06/21,00:41:59\r
-334,25.954618,-80.141903,"WPT334",3.0,1.54,2008/06/21,00:42:05\r
-335,25.954683,-80.141923,"WPT335",4.0,0.00,2008/06/21,00:42:10\r
-336,25.954732,-80.141937,"WPT336",4.0,1.54,2008/06/21,00:42:15\r
-337,25.954848,-80.142003,"WPT337",4.0,2.57,2008/06/21,00:42:21\r
-338,25.954972,-80.142035,"WPT338",4.0,3.60,2008/06/21,00:42:26\r
-339,25.955130,-80.142070,"WPT339",5.0,1.54,2008/06/21,00:42:31\r
-340,25.955165,-80.142090,"WPT340",6.0,0.00,2008/06/21,00:42:37\r
-341,25.955162,-80.142098,"WPT341",7.0,0.00,2008/06/21,00:42:42\r
-342,25.955190,-80.142110,"WPT342",7.0,1.03,2008/06/21,00:42:47\r
-343,25.955258,-80.142122,"WPT343",8.0,1.54,2008/06/21,00:42:53\r
-344,25.955360,-80.142175,"WPT344",8.0,2.57,2008/06/21,00:42:58\r
-345,25.955415,-80.142275,"WPT345",8.0,2.06,2008/06/21,00:43:03\r
-346,25.955375,-80.142365,"WPT346",8.0,1.03,2008/06/21,00:43:09\r
-347,25.955347,-80.142358,"WPT347",10.0,0.00,2008/06/21,00:43:14\r
-348,25.955315,-80.142352,"WPT348",11.0,0.51,2008/06/21,00:43:19\r
-349,25.955248,-80.142335,"WPT349",10.0,1.54,2008/06/21,00:43:25\r
-350,25.955145,-80.142303,"WPT350",9.0,2.06,2008/06/21,00:43:30\r
-351,25.955052,-80.142277,"WPT351",9.0,1.54,2008/06/21,00:43:35\r
-352,25.954935,-80.142245,"WPT352",9.0,2.06,2008/06/21,00:43:41\r
-353,25.954847,-80.142215,"WPT353",9.0,1.54,2008/06/21,00:43:46\r
-354,25.954758,-80.142185,"WPT354",8.0,1.54,2008/06/21,00:43:51\r
-355,25.954602,-80.142133,"WPT355",8.0,4.12,2008/06/21,00:43:57\r
-356,25.954462,-80.142093,"WPT356",7.0,1.54,2008/06/21,00:44:02\r
-357,25.954388,-80.142077,"WPT357",7.0,1.03,2008/06/21,00:44:07\r
-358,25.954365,-80.142070,"WPT358",7.0,0.51,2008/06/21,00:44:13\r
-359,25.954253,-80.142008,"WPT359",6.0,4.12,2008/06/21,00:44:18\r
-360,25.954162,-80.142068,"WPT360",5.0,1.54,2008/06/21,00:44:24\r
-361,25.954217,-80.142173,"WPT361",6.0,3.60,2008/06/21,00:44:29\r
-362,25.954418,-80.142235,"WPT362",6.0,4.12,2008/06/21,00:44:34\r
-363,25.954590,-80.142278,"WPT363",6.0,2.06,2008/06/21,00:44:40\r
-364,25.954643,-80.142295,"WPT364",6.0,0.00,2008/06/21,00:44:45\r
-365,25.954645,-80.142293,"WPT365",5.0,0.00,2008/06/21,00:44:50\r
-366,25.954797,-80.142340,"WPT366",5.0,3.60,2008/06/21,00:44:56\r
-367,25.954960,-80.142392,"WPT367",5.0,3.09,2008/06/21,00:45:01\r
-368,25.955030,-80.142412,"WPT368",5.0,0.00,2008/06/21,00:45:06\r
-369,25.955030,-80.142412,"WPT369",5.0,0.00,2008/06/21,00:45:12\r
-370,25.955030,-80.142410,"WPT370",5.0,0.00,2008/06/21,00:45:17\r
-371,25.955018,-80.142407,"WPT371",6.0,0.00,2008/06/21,00:45:22\r
-372,25.955010,-80.142403,"WPT372",6.0,0.00,2008/06/21,00:45:28\r
-373,25.955008,-80.142402,"WPT373",6.0,0.00,2008/06/21,00:45:33\r
-374,25.955027,-80.142417,"WPT374",5.0,1.54,2008/06/21,00:45:38\r
-375,25.955072,-80.142417,"WPT375",5.0,0.00,2008/06/21,00:45:44\r
-376,25.955073,-80.142408,"WPT376",4.0,0.00,2008/06/21,00:45:49\r
-377,25.955072,-80.142363,"WPT377",5.0,0.00,2008/06/21,00:45:54\r
-378,25.955070,-80.142372,"WPT378",5.0,0.00,2008/06/21,00:46:00\r
-379,25.955070,-80.142377,"WPT379",5.0,0.00,2008/06/21,00:46:05\r
-380,25.955072,-80.142378,"WPT380",6.0,0.00,2008/06/21,00:46:10\r
-381,25.955073,-80.142385,"WPT381",7.0,0.00,2008/06/21,00:46:16\r
-382,25.955077,-80.142388,"WPT382",7.0,0.00,2008/06/21,00:46:21\r
-383,25.955077,-80.142388,"WPT383",8.0,0.00,2008/06/21,00:46:26\r
-384,25.955075,-80.142388,"WPT384",9.0,0.00,2008/06/21,00:46:32\r
-385,25.955077,-80.142392,"WPT385",10.0,0.00,2008/06/21,00:46:37\r
-386,25.955080,-80.142390,"WPT386",9.0,0.00,2008/06/21,00:46:42\r
-387,25.955080,-80.142387,"WPT387",9.0,0.00,2008/06/21,00:46:48\r
-388,25.955080,-80.142385,"WPT388",8.0,0.00,2008/06/21,00:46:53\r
-389,25.955080,-80.142385,"WPT389",8.0,0.00,2008/06/21,00:46:59\r
-390,25.955080,-80.142385,"WPT390",8.0,0.00,2008/06/21,00:47:04\r
-391,25.955080,-80.142385,"WPT391",8.0,0.00,2008/06/21,00:47:09\r
-392,25.955080,-80.142385,"WPT392",7.0,0.00,2008/06/21,00:47:15\r
-393,25.955080,-80.142385,"WPT393",7.0,0.00,2008/06/21,00:47:20\r
-394,25.955080,-80.142385,"WPT394",7.0,0.00,2008/06/21,00:47:25\r
-395,25.955080,-80.142385,"WPT395",7.0,0.00,2008/06/21,00:47:31\r
-396,25.955078,-80.142385,"WPT396",7.0,0.00,2008/06/21,00:47:36\r
-397,25.955078,-80.142387,"WPT397",7.0,0.00,2008/06/21,00:47:41\r
-398,25.955080,-80.142385,"WPT398",8.0,0.00,2008/06/21,00:47:47\r
-399,25.955080,-80.142385,"WPT399",8.0,0.00,2008/06/21,00:47:52\r
-400,25.955080,-80.142383,"WPT400",7.0,0.00,2008/06/21,00:47:57\r
-401,25.955080,-80.142383,"WPT401",7.0,0.00,2008/06/21,00:48:03\r
-402,25.955080,-80.142382,"WPT402",7.0,0.00,2008/06/21,00:48:08\r
-403,25.955080,-80.142380,"WPT403",7.0,0.00,2008/06/21,00:48:13\r
-404,25.955082,-80.142380,"WPT404",8.0,0.00,2008/06/21,00:48:19\r
-405,25.955082,-80.142378,"WPT405",8.0,0.00,2008/06/21,00:48:24\r
-406,25.955083,-80.142378,"WPT406",8.0,0.00,2008/06/21,00:48:29\r
-407,25.955083,-80.142378,"WPT407",8.0,0.00,2008/06/21,00:48:35\r
-408,25.955085,-80.142378,"WPT408",9.0,0.00,2008/06/21,00:48:40\r
-409,25.955085,-80.142377,"WPT409",9.0,0.00,2008/06/21,00:48:45\r
-410,25.955087,-80.142377,"WPT410",9.0,0.00,2008/06/21,00:48:51\r
-411,25.955087,-80.142377,"WPT411",9.0,0.00,2008/06/21,00:48:56\r
-412,25.955087,-80.142377,"WPT412",9.0,0.00,2008/06/21,00:49:01\r
-413,25.955087,-80.142377,"WPT413",10.0,0.00,2008/06/21,00:49:07\r
-414,25.955087,-80.142378,"WPT414",10.0,0.00,2008/06/21,00:49:12\r
-415,25.955088,-80.142378,"WPT415",10.0,0.00,2008/06/21,00:49:18\r
-416,25.955088,-80.142378,"WPT416",10.0,0.00,2008/06/21,00:49:23\r
-417,25.955088,-80.142380,"WPT417",10.0,0.00,2008/06/21,00:49:28\r
-418,25.955088,-80.142378,"WPT418",10.0,0.00,2008/06/21,00:49:34\r
-419,25.955087,-80.142378,"WPT419",10.0,0.00,2008/06/21,00:49:39\r
-420,25.955087,-80.142377,"WPT420",10.0,0.00,2008/06/21,00:49:44\r
-421,25.955088,-80.142377,"WPT421",9.0,0.00,2008/06/21,00:49:50\r
-422,25.955088,-80.142377,"WPT422",9.0,0.00,2008/06/21,00:49:55\r
-423,25.955088,-80.142377,"WPT423",9.0,0.00,2008/06/21,00:50:00\r
-424,25.955087,-80.142377,"WPT424",9.0,0.00,2008/06/21,00:50:06\r
-425,25.955087,-80.142377,"WPT425",9.0,0.00,2008/06/21,00:50:11\r
-426,25.955087,-80.142377,"WPT426",9.0,0.00,2008/06/21,00:50:16\r
-427,25.955087,-80.142375,"WPT427",9.0,0.00,2008/06/21,00:50:22\r
-428,25.955087,-80.142377,"WPT428",9.0,0.00,2008/06/21,00:50:27\r
-429,25.955087,-80.142377,"WPT429",9.0,0.00,2008/06/21,00:50:32\r
-430,25.955087,-80.142377,"WPT430",9.0,0.00,2008/06/21,00:50:38\r
-431,25.955087,-80.142377,"WPT431",9.0,0.00,2008/06/21,00:50:43\r
-432,25.955085,-80.142377,"WPT432",9.0,0.00,2008/06/21,00:50:48\r
-433,25.955085,-80.142377,"WPT433",9.0,0.00,2008/06/21,00:50:54\r
-434,25.955085,-80.142377,"WPT434",9.0,0.00,2008/06/21,00:50:59\r
-435,25.955085,-80.142377,"WPT435",9.0,0.00,2008/06/21,00:51:04\r
-436,25.955085,-80.142378,"WPT436",9.0,0.00,2008/06/21,00:51:10\r
-437,25.955085,-80.142378,"WPT437",9.0,0.00,2008/06/21,00:51:15\r
-438,25.955085,-80.142380,"WPT438",9.0,0.00,2008/06/21,00:51:20\r
-439,25.955085,-80.142382,"WPT439",9.0,0.00,2008/06/21,00:51:26\r
-440,25.955085,-80.142382,"WPT440",9.0,0.00,2008/06/21,00:51:31\r
-441,25.955085,-80.142383,"WPT441",9.0,0.00,2008/06/21,00:51:36\r
-442,25.955085,-80.142383,"WPT442",9.0,0.00,2008/06/21,00:51:42\r
-443,25.955083,-80.142383,"WPT443",9.0,0.00,2008/06/21,00:51:47\r
-444,25.955082,-80.142383,"WPT444",9.0,0.00,2008/06/21,00:51:53\r
-445,25.955082,-80.142385,"WPT445",9.0,0.00,2008/06/21,00:51:58\r
-446,25.955080,-80.142385,"WPT446",9.0,0.00,2008/06/21,00:52:03\r
-447,25.955080,-80.142385,"WPT447",9.0,0.00,2008/06/21,00:52:09\r
-448,25.955078,-80.142387,"WPT448",9.0,0.00,2008/06/21,00:52:14\r
-449,25.955078,-80.142387,"WPT449",9.0,0.00,2008/06/21,00:52:19\r
-450,25.955078,-80.142387,"WPT450",9.0,0.00,2008/06/21,00:52:25\r
-451,25.955077,-80.142388,"WPT451",9.0,0.00,2008/06/21,00:52:30\r
-452,25.955077,-80.142388,"WPT452",9.0,0.00,2008/06/21,00:52:35\r
-453,25.955077,-80.142390,"WPT453",9.0,0.00,2008/06/21,00:52:41\r
-454,25.955077,-80.142390,"WPT454",9.0,0.00,2008/06/21,00:52:46\r
-455,25.955077,-80.142390,"WPT455",9.0,0.00,2008/06/21,00:52:51\r
-456,25.955077,-80.142390,"WPT456",9.0,0.00,2008/06/21,00:52:57\r
-457,25.955077,-80.142392,"WPT457",8.0,0.00,2008/06/21,00:53:02\r
-458,25.955077,-80.142390,"WPT458",8.0,0.00,2008/06/21,00:53:07\r
-459,25.955077,-80.142390,"WPT459",8.0,0.00,2008/06/21,00:53:13\r
-460,25.955077,-80.142390,"WPT460",8.0,0.00,2008/06/21,00:53:18\r
-461,25.955078,-80.142390,"WPT461",8.0,0.00,2008/06/21,00:53:23\r
-462,25.955078,-80.142390,"WPT462",7.0,0.00,2008/06/21,00:53:29\r
-463,25.955078,-80.142390,"WPT463",7.0,0.00,2008/06/21,00:53:34\r
-464,25.955078,-80.142390,"WPT464",7.0,0.00,2008/06/21,00:53:39\r
-465,25.955080,-80.142390,"WPT465",7.0,0.00,2008/06/21,00:53:45\r
-466,25.955080,-80.142390,"WPT466",7.0,0.00,2008/06/21,00:53:50\r
-467,25.955080,-80.142390,"WPT467",7.0,0.00,2008/06/21,00:53:55\r
-468,25.955080,-80.142390,"WPT468",7.0,0.00,2008/06/21,00:54:01\r
-469,25.955082,-80.142390,"WPT469",7.0,0.00,2008/06/21,00:54:06\r
-470,25.955082,-80.142392,"WPT470",7.0,0.00,2008/06/21,00:54:11\r
-471,25.955083,-80.142390,"WPT471",7.0,0.00,2008/06/21,00:54:17\r
-472,25.955083,-80.142390,"WPT472",7.0,0.00,2008/06/21,00:54:22\r
-473,25.955083,-80.142390,"WPT473",7.0,0.00,2008/06/21,00:54:28\r
-474,25.955083,-80.142388,"WPT474",7.0,0.00,2008/06/21,00:54:33\r
-475,25.955083,-80.142388,"WPT475",7.0,0.00,2008/06/21,00:54:38\r
-476,25.955083,-80.142387,"WPT476",7.0,0.00,2008/06/21,00:54:44\r
-477,25.955083,-80.142387,"WPT477",7.0,0.00,2008/06/21,00:54:49\r
-478,25.955083,-80.142385,"WPT478",8.0,0.00,2008/06/21,00:54:54\r
-479,25.955083,-80.142385,"WPT479",8.0,0.00,2008/06/21,00:55:00\r
-480,25.955083,-80.142383,"WPT480",8.0,0.00,2008/06/21,00:55:05\r
-481,25.955083,-80.142383,"WPT481",8.0,0.00,2008/06/21,00:55:10\r
-482,25.955083,-80.142383,"WPT482",8.0,0.00,2008/06/21,00:55:16\r
-483,25.955085,-80.142383,"WPT483",8.0,0.00,2008/06/21,00:55:21\r
-484,25.955085,-80.142383,"WPT484",8.0,0.00,2008/06/21,00:55:26\r
-485,25.955085,-80.142383,"WPT485",8.0,0.00,2008/06/21,00:55:32\r
-486,25.955085,-80.142383,"WPT486",8.0,0.00,2008/06/21,00:55:37\r
-487,25.955085,-80.142383,"WPT487",8.0,0.00,2008/06/21,00:55:42\r
-488,25.955085,-80.142382,"WPT488",9.0,0.00,2008/06/21,00:55:48\r
-489,25.955083,-80.142382,"WPT489",9.0,0.00,2008/06/21,00:55:53\r
-490,25.955083,-80.142382,"WPT490",9.0,0.00,2008/06/21,00:55:58\r
-491,25.955085,-80.142380,"WPT491",8.0,0.00,2008/06/21,00:56:04\r
-492,25.955085,-80.142380,"WPT492",8.0,0.00,2008/06/21,00:56:09\r
-493,25.955085,-80.142380,"WPT493",8.0,0.00,2008/06/21,00:56:14\r
-494,25.955085,-80.142380,"WPT494",8.0,0.00,2008/06/21,00:56:20\r
-495,25.955085,-80.142380,"WPT495",8.0,0.00,2008/06/21,00:56:25\r
-496,25.955087,-80.142380,"WPT496",8.0,0.00,2008/06/21,00:56:30\r
-497,25.955087,-80.142380,"WPT497",8.0,0.00,2008/06/21,00:56:36\r
-498,25.955087,-80.142382,"WPT498",8.0,0.00,2008/06/21,00:56:41\r
-499,25.955087,-80.142382,"WPT499",8.0,0.00,2008/06/21,00:56:46\r
-500,25.955085,-80.142383,"WPT500",8.0,0.00,2008/06/21,00:56:52\r
-501,25.955087,-80.142383,"WPT501",8.0,0.00,2008/06/21,00:56:57\r
-502,25.955087,-80.142383,"WPT502",8.0,0.00,2008/06/21,00:57:03\r
-503,25.955087,-80.142385,"WPT503",8.0,0.00,2008/06/21,00:57:08\r
-504,25.955087,-80.142385,"WPT504",8.0,0.00,2008/06/21,00:57:13\r
-505,25.955087,-80.142387,"WPT505",8.0,0.00,2008/06/21,00:57:19\r
-506,25.955087,-80.142387,"WPT506",8.0,0.00,2008/06/21,00:57:24\r
-507,25.955087,-80.142387,"WPT507",8.0,0.00,2008/06/21,00:57:29\r
-508,25.955087,-80.142387,"WPT508",9.0,0.00,2008/06/21,00:57:35\r
-509,25.955087,-80.142387,"WPT509",9.0,0.00,2008/06/21,00:57:40\r
-510,25.955087,-80.142388,"WPT510",9.0,0.00,2008/06/21,00:57:45\r
-511,25.955087,-80.142388,"WPT511",9.0,0.00,2008/06/21,00:57:51\r
-512,25.955087,-80.142388,"WPT512",9.0,0.00,2008/06/21,00:57:56\r
-513,25.955087,-80.142387,"WPT513",10.0,0.00,2008/06/21,00:58:01\r
-514,25.955085,-80.142387,"WPT514",10.0,0.00,2008/06/21,00:58:07\r
-515,25.955085,-80.142387,"WPT515",10.0,0.00,2008/06/21,00:58:12\r
-516,25.955085,-80.142385,"WPT516",10.0,0.00,2008/06/21,00:58:17\r
-517,25.955083,-80.142385,"WPT517",10.0,0.00,2008/06/21,00:58:23\r
-518,25.955083,-80.142387,"WPT518",10.0,0.00,2008/06/21,00:58:28\r
-519,25.955082,-80.142387,"WPT519",10.0,0.00,2008/06/21,00:58:33\r
-520,25.955082,-80.142387,"WPT520",10.0,0.00,2008/06/21,00:58:39\r
-521,25.955080,-80.142387,"WPT521",9.0,0.00,2008/06/21,00:58:44\r
-522,25.955082,-80.142385,"WPT522",9.0,0.00,2008/06/21,00:58:49\r
-523,25.955082,-80.142385,"WPT523",9.0,0.00,2008/06/21,00:58:55\r
-524,25.955082,-80.142383,"WPT524",9.0,0.00,2008/06/21,00:59:00\r
-525,25.955082,-80.142383,"WPT525",9.0,0.00,2008/06/21,00:59:05\r
-526,25.955083,-80.142382,"WPT526",9.0,0.00,2008/06/21,00:59:11\r
-527,25.955083,-80.142382,"WPT527",9.0,0.00,2008/06/21,00:59:16\r
-528,25.955083,-80.142382,"WPT528",9.0,0.00,2008/06/21,00:59:21\r
-529,25.955083,-80.142382,"WPT529",9.0,0.00,2008/06/21,00:59:27\r
-530,25.955083,-80.142382,"WPT530",9.0,0.00,2008/06/21,00:59:32\r
-531,25.955083,-80.142382,"WPT531",9.0,0.00,2008/06/21,00:59:38\r
-532,25.955083,-80.142382,"WPT532",9.0,0.00,2008/06/21,00:59:43\r
-533,25.955083,-80.142382,"WPT533",9.0,0.00,2008/06/21,00:59:48\r
-534,25.955083,-80.142382,"WPT534",9.0,0.00,2008/06/21,00:59:54\r
-535,25.955083,-80.142382,"WPT535",9.0,0.00,2008/06/21,00:59:59\r
-536,25.955083,-80.142382,"WPT536",9.0,0.00,2008/06/21,01:00:04\r
-537,25.955083,-80.142382,"WPT537",9.0,0.00,2008/06/21,01:00:10\r
-538,25.955082,-80.142382,"WPT538",8.0,0.00,2008/06/21,01:00:15\r
-539,25.955082,-80.142382,"WPT539",8.0,0.00,2008/06/21,01:00:20\r
-540,25.955082,-80.142382,"WPT540",8.0,0.00,2008/06/21,01:00:26\r
-541,25.955082,-80.142382,"WPT541",8.0,0.00,2008/06/21,01:00:31\r
-542,25.955082,-80.142382,"WPT542",8.0,0.00,2008/06/21,01:00:36\r
-543,25.955082,-80.142382,"WPT543",8.0,0.00,2008/06/21,01:00:42\r
-544,25.955082,-80.142382,"WPT544",8.0,0.00,2008/06/21,01:00:47\r
-545,25.955082,-80.142382,"WPT545",9.0,0.00,2008/06/21,01:00:52\r
-546,25.955082,-80.142382,"WPT546",9.0,0.00,2008/06/21,01:00:58\r
-547,25.955082,-80.142382,"WPT547",9.0,0.00,2008/06/21,01:01:03\r
-548,25.955082,-80.142382,"WPT548",9.0,0.00,2008/06/21,01:01:08\r
-549,25.955082,-80.142380,"WPT549",9.0,0.00,2008/06/21,01:01:14\r
-550,25.955082,-80.142380,"WPT550",9.0,0.00,2008/06/21,01:01:19\r
-551,25.955082,-80.142380,"WPT551",9.0,0.00,2008/06/21,01:01:24\r
-552,25.955082,-80.142378,"WPT552",9.0,0.00,2008/06/21,01:01:30\r
-553,25.955082,-80.142378,"WPT553",9.0,0.00,2008/06/21,01:01:35\r
-554,25.955083,-80.142378,"WPT554",9.0,0.00,2008/06/21,01:01:40\r
-555,25.955083,-80.142380,"WPT555",9.0,0.00,2008/06/21,01:01:46\r
-556,25.955083,-80.142380,"WPT556",10.0,0.00,2008/06/21,01:01:51\r
-557,25.955083,-80.142380,"WPT557",10.0,0.00,2008/06/21,01:01:56\r
-558,25.955083,-80.142382,"WPT558",10.0,0.00,2008/06/21,01:02:02\r
-559,25.955083,-80.142383,"WPT559",10.0,0.00,2008/06/21,01:02:07\r
-560,25.955083,-80.142385,"WPT560",10.0,0.00,2008/06/21,01:02:13\r
-561,25.955083,-80.142387,"WPT561",10.0,0.00,2008/06/21,01:02:18\r
-562,25.955083,-80.142390,"WPT562",10.0,0.00,2008/06/21,01:02:23\r
-563,25.955083,-80.142392,"WPT563",11.0,0.00,2008/06/21,01:02:29\r
-564,25.955042,-80.142213,"WPT564",36.0,0.00,2008/06/21,02:20:58\r
-565,25.955058,-80.142408,"WPT565",13.0,0.00,2008/06/21,02:21:05\r
-566,25.955048,-80.142400,"WPT566",9.0,0.00,2008/06/21,02:21:09\r
-567,25.955053,-80.142393,"WPT567",9.0,0.00,2008/06/21,02:21:14\r
-568,25.955055,-80.142392,"WPT568",10.0,0.00,2008/06/21,02:21:20\r
-569,25.955055,-80.142392,"WPT569",11.0,0.00,2008/06/21,02:21:25\r
-570,25.955053,-80.142390,"WPT570",11.0,0.00,2008/06/21,02:21:30\r
-571,25.955050,-80.142390,"WPT571",11.0,0.00,2008/06/21,02:21:36\r
-572,25.955048,-80.142388,"WPT572",11.0,0.00,2008/06/21,02:21:41\r
-573,25.955045,-80.142388,"WPT573",11.0,0.00,2008/06/21,02:21:47\r
-574,25.955043,-80.142387,"WPT574",11.0,0.00,2008/06/21,02:21:52\r
-575,25.955040,-80.142387,"WPT575",11.0,0.00,2008/06/21,02:21:57\r
-576,25.955035,-80.142390,"WPT576",10.0,0.00,2008/06/21,02:22:03\r
-577,25.955032,-80.142402,"WPT577",9.0,0.51,2008/06/21,02:22:08\r
-578,25.955018,-80.142435,"WPT578",9.0,0.51,2008/06/21,02:22:13\r
-579,25.955007,-80.142447,"WPT579",9.0,0.51,2008/06/21,02:22:19\r
-580,25.955092,-80.142458,"WPT580",8.0,2.06,2008/06/21,02:22:24\r
-581,25.955173,-80.142492,"WPT581",8.0,1.03,2008/06/21,02:22:29\r
-582,25.955255,-80.142458,"WPT582",9.0,2.06,2008/06/21,02:22:35\r
-583,25.955285,-80.142373,"WPT583",8.0,1.54,2008/06/21,02:22:40\r
-584,25.955213,-80.142330,"WPT584",9.0,2.06,2008/06/21,02:22:45\r
-585,25.955135,-80.142313,"WPT585",10.0,1.03,2008/06/21,02:22:51\r
-586,25.955022,-80.142277,"WPT586",11.0,3.60,2008/06/21,02:22:56\r
-587,25.954843,-80.142225,"WPT587",12.0,4.12,2008/06/21,02:23:01\r
-588,25.954610,-80.142145,"WPT588",12.0,4.63,2008/06/21,02:23:07\r
-589,25.954380,-80.142062,"WPT589",12.0,5.14,2008/06/21,02:23:12\r
-590,25.954168,-80.142007,"WPT590",11.0,3.60,2008/06/21,02:23:17\r
-591,25.954077,-80.142095,"WPT591",11.0,2.06,2008/06/21,02:23:23\r
-592,25.954063,-80.142125,"WPT592",11.0,0.00,2008/06/21,02:23:28\r
-593,25.954062,-80.142130,"WPT593",11.0,0.51,2008/06/21,02:23:33\r
-594,25.954007,-80.142237,"WPT594",13.0,2.57,2008/06/21,02:23:39\r
-595,25.954053,-80.142355,"WPT595",13.0,0.51,2008/06/21,02:23:44\r
-596,25.954072,-80.142387,"WPT596",14.0,1.03,2008/06/21,02:23:49\r
-597,25.954153,-80.142583,"WPT597",13.0,3.60,2008/06/21,02:23:55\r
-598,25.954213,-80.142717,"WPT598",14.0,2.06,2008/06/21,02:24:00\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
- <time>1970-01-01T00:00:00Z</time>
- <bounds minlat="48.623286047" minlon="9.895914981" maxlat="51.593568734" maxlon="12.598730495"/>
- <wpt lat="51.593568734" lon="9.895914981">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr1-one</name>
- <cmt>Qr1-one</cmt>
- <desc>notes-1</desc>
- <sym>Red Square</sym>
- </wpt>
- <wpt lat="50.833425048" lon="10.364770734">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr,2</name>
- <cmt>Qr,2</cmt>
- <desc>notes-2</desc>
- <sym>Big Fish</sym>
- </wpt>
- <wpt lat="50.184475274" lon="10.557828985">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr3</name>
- <cmt>Qr3</cmt>
- <desc>notes-3</desc>
- <sym>Anchor</sym>
- </wpt>
- <wpt lat="48.986577919" lon="12.047135492">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr4-four</name>
- <cmt>Qr4-four</cmt>
- <desc>notes-4</desc>
- <sym>Smiley</sym>
- </wpt>
- <wpt lat="48.623286047" lon="12.598730495">
- <time>2006-11-06T21:07:43Z</time>
- <name>Qr5</name>
- <cmt>Qr5</cmt>
- <desc>notes-5</desc>
- <sym>Sad</sym>
- </wpt>
- <rte>
- <name>Qr</name>
- <rtept lat="51.593568734" lon="9.895914981">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr1-one</name>
- <cmt>Qr1-one</cmt>
- <desc>notes-1</desc>
- <sym>Red Square</sym>
- </rtept>
- <rtept lat="50.833425048" lon="10.364770734">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr,2</name>
- <cmt>Qr,2</cmt>
- <desc>notes-2</desc>
- <sym>Big Fish</sym>
- </rtept>
- <rtept lat="50.184475274" lon="10.557828985">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr3</name>
- <cmt>Qr3</cmt>
- <desc>notes-3</desc>
- <sym>Anchor</sym>
- </rtept>
- <rtept lat="48.986577919" lon="12.047135492">
- <time>2006-11-06T21:07:41Z</time>
- <name>Qr4-four</name>
- <cmt>Qr4-four</cmt>
- <desc>notes-4</desc>
- <sym>Smiley</sym>
- </rtept>
- <rtept lat="48.623286047" lon="12.598730495">
- <time>2006-11-06T21:07:43Z</time>
- <name>Qr5</name>
- <cmt>Qr5</cmt>
- <desc>notes-5</desc>
- <sym>Sad</sym>
- </rtept>
- </rte>
-</gpx>
+++ /dev/null
-[Wp0]\r
-Loc=Qr\r
-Name=Qr1-one\r
-Lat=51.593568734471624\r
-Long=9.895914981396029\r
-Rng=0.000000000000000\r
-Bear=0.000000000000000\r
-Bmp=3\r
-Fixed=1\r
-Locked=0\r
-Notes=notes-1\r
-Rel=\r
-RelSet=1\r
-RcCount=1\r
-RcRadius=0.000000000000000\r
-Show=0\r
-RcShow=0\r
-SeaTemp=-32678.000000000000000\r
-Depth=65535.000000000000000\r
-Time=39027.880335648151000\r
-GUID=41847-17743-33206-33476\r
-[Wp1]\r
-Loc=Qr\r
-Name=Qr,2\r
-Lat=50.833425047658316\r
-Long=10.364770733812209\r
-Rng=0.000000000000000\r
-Bear=0.000000000000000\r
-Bmp=4\r
-Fixed=1\r
-Locked=0\r
-Notes=notes-2\r
-Rel=\r
-RelSet=1\r
-RcCount=1\r
-RcRadius=0.000000000000000\r
-Show=0\r
-RcShow=0\r
-SeaTemp=-32678.000000000000000\r
-Depth=65535.000000000000000\r
-Time=39027.880347222221000\r
-GUID=41847-17743-33462-33476\r
-[Wp2]\r
-Loc=Qr\r
-Name=Qr3\r
-Lat=50.184475273537196\r
-Long=10.557828984807108\r
-Rng=0.000000000000000\r
-Bear=0.000000000000000\r
-Bmp=5\r
-Fixed=1\r
-Locked=0\r
-Notes=notes-3\r
-Rel=\r
-RelSet=1\r
-RcCount=1\r
-RcRadius=0.000000000000000\r
-Show=0\r
-RcShow=0\r
-SeaTemp=-32678.000000000000000\r
-Depth=65535.000000000000000\r
-Time=39027.880347222221000\r
-GUID=41847-17743-33718-33476\r
-[Wp3]\r
-Loc=Qr\r
-Name=Qr4-four\r
-Lat=48.986577919201942\r
-Long=12.047135492482036\r
-Rng=0.000000000000000\r
-Bear=0.000000000000000\r
-Bmp=6\r
-Fixed=1\r
-Locked=0\r
-Notes=notes-4\r
-Rel=\r
-RelSet=1\r
-RcCount=1\r
-RcRadius=0.000000000000000\r
-Show=0\r
-RcShow=0\r
-SeaTemp=-32678.000000000000000\r
-Depth=65535.000000000000000\r
-Time=39027.880347222221000\r
-GUID=41847-17743-33974-33476\r
-[Wp4]\r
-Loc=Qr\r
-Name=Qr5\r
-Lat=48.623286046917791\r
-Long=12.598730495324602\r
-Rng=0.000000000000000\r
-Bear=0.000000000000000\r
-Bmp=7\r
-Fixed=1\r
-Locked=0\r
-Notes=notes-5\r
-Rel=\r
-RelSet=1\r
-RcCount=1\r
-RcRadius=0.000000000000000\r
-Show=0\r
-RcShow=0\r
-SeaTemp=-32678.000000000000000\r
-Depth=65535.000000000000000\r
-Time=39027.880358796298000\r
-GUID=41847-17743-34230-33476\r
-[Rt0]\r
-Name=Qr\r
-Visible=0\r
-Guid=41847-17743-32950-33476\r
-Mk0=Qr1-one\r
-Cog0=0.000000000000000\r
-Eta0=0.000000000000000\r
-Length0=0.000000000000000\r
-PredictedDrift0=0.000000000000000\r
-PredictedSet0=0.000000000000000\r
-PredictedSog0=0.000000000000000\r
-PredictedTime0=0.000000000000000\r
-PredictedTwa0=0.000000000000000\r
-PredictedTwd0=0.000000000000000\r
-PredictedTws0=0.000000000000000\r
-Mk1=Qr,2\r
-Cog1=0.000000000000000\r
-Eta1=0.000000000000000\r
-Length1=0.000000000000000\r
-PredictedDrift1=0.000000000000000\r
-PredictedSet1=0.000000000000000\r
-PredictedSog1=0.000000000000000\r
-PredictedTime1=0.000000000000000\r
-PredictedTwa1=0.000000000000000\r
-PredictedTwd1=0.000000000000000\r
-PredictedTws1=0.000000000000000\r
-Mk2=Qr3\r
-Cog2=0.000000000000000\r
-Eta2=0.000000000000000\r
-Length2=0.000000000000000\r
-PredictedDrift2=0.000000000000000\r
-PredictedSet2=0.000000000000000\r
-PredictedSog2=0.000000000000000\r
-PredictedTime2=0.000000000000000\r
-PredictedTwa2=0.000000000000000\r
-PredictedTwd2=0.000000000000000\r
-PredictedTws2=0.000000000000000\r
-Mk3=Qr4-four\r
-Cog3=0.000000000000000\r
-Eta3=0.000000000000000\r
-Length3=0.000000000000000\r
-PredictedDrift3=0.000000000000000\r
-PredictedSet3=0.000000000000000\r
-PredictedSog3=0.000000000000000\r
-PredictedTime3=0.000000000000000\r
-PredictedTwa3=0.000000000000000\r
-PredictedTwd3=0.000000000000000\r
-PredictedTws3=0.000000000000000\r
-Mk4=Qr5\r
-Cog4=0.000000000000000\r
-Eta4=0.000000000000000\r
-Length4=0.000000000000000\r
-PredictedDrift4=0.000000000000000\r
-PredictedSet4=0.000000000000000\r
-PredictedSog4=0.000000000000000\r
-PredictedTime4=0.000000000000000\r
-PredictedTwa4=0.000000000000000\r
-PredictedTwd4=0.000000000000000\r
-PredictedTws4=0.000000000000000\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
- <time>1970-01-01T00:00:00Z</time>
- <bounds minlat="46.354380000" minlon="6.170210000" maxlat="47.544970000" maxlon="8.261100000"/>
- <wpt lat="46.354380000" lon="6.170210000">
- <name>Aebi Frères, Bogis-Bossey</name>
- <cmt>Aebi Frères, Bogis-Bossey</cmt>
- <desc>Aebi Frères, Bogis-Bossey</desc>
- </wpt>
- <wpt lat="46.476570000" lon="6.428500000">
- <name>Eco Energy Etoy</name>
- <cmt>Eco Energy Etoy</cmt>
- <desc>Eco Energy Etoy</desc>
- </wpt>
- <wpt lat="46.568200000" lon="6.449520000">
- <name>Mühle Severy</name>
- <cmt>Mühle Severy</cmt>
- <desc>Mühle Severy</desc>
- </wpt>
- <wpt lat="46.696180000" lon="6.477960000">
- <name>Centre Silo Croy</name>
- <cmt>Centre Silo Croy</cmt>
- <desc>Centre Silo Croy</desc>
- </wpt>
- <wpt lat="46.824320000" lon="6.655290000">
- <name>Michel Forestier Champagne</name>
- <cmt>Michel Forestier Champagne</cmt>
- <desc>Michel Forestier Champagne</desc>
- </wpt>
- <wpt lat="46.667660000" lon="6.805070000">
- <name>A S S Moudon</name>
- <cmt>A S S Moudon</cmt>
- <desc>A S S Moudon</desc>
- </wpt>
- <wpt lat="46.570380000" lon="6.818150000">
- <name>Caro Oron</name>
- <cmt>Caro Oron</cmt>
- <desc>Caro Oron</desc>
- </wpt>
- <wpt lat="46.710910000" lon="6.848600000">
- <name>Protector Lucens</name>
- <cmt>Protector Lucens</cmt>
- <desc>Protector Lucens</desc>
- </wpt>
- <wpt lat="47.047700000" lon="6.874040000">
- <name>Landi Hauts Geneveys</name>
- <cmt>Landi Hauts Geneveys</cmt>
- <desc>Landi Hauts Geneveys</desc>
- </wpt>
- <wpt lat="46.828550000" lon="6.940470000">
- <name>Von Bergen Payern</name>
- <cmt>Von Bergen Payern</cmt>
- <desc>Von Bergen Payern</desc>
- </wpt>
- <wpt lat="46.916580000" lon="6.968530000">
- <name>DSP Delley-Portalban</name>
- <cmt>DSP Delley-Portalban</cmt>
- <desc>DSP Delley-Portalban</desc>
- </wpt>
- <wpt lat="46.851650000" lon="7.189880000">
- <name>SGD Düdingen</name>
- <cmt>SGD Düdingen</cmt>
- <desc>SGD Düdingen</desc>
- </wpt>
- <wpt lat="46.939730000" lon="7.207620000">
- <name>Mühle Rytz Biberen</name>
- <cmt>Mühle Rytz Biberen</cmt>
- <desc>Mühle Rytz Biberen</desc>
- </wpt>
- <wpt lat="46.928570000" lon="7.235100000">
- <name>Trocknungsanlage Laupen</name>
- <cmt>Trocknungsanlage Laupen</cmt>
- <desc>Trocknungsanlage Laupen</desc>
- </wpt>
- <wpt lat="47.041610000" lon="7.255410000">
- <name>TR BARGEN</name>
- <cmt>TR BARGEN</cmt>
- <desc>TR BARGEN</desc>
- </wpt>
- <wpt lat="47.069610000" lon="7.292770000">
- <name>Gygi AG</name>
- <cmt>Gygi AG</cmt>
- <desc>Gygi AG</desc>
- </wpt>
- <wpt lat="46.825990000" lon="7.301480000">
- <name>Landi Heitenried</name>
- <cmt>Landi Heitenried</cmt>
- <desc>Landi Heitenried</desc>
- </wpt>
- <wpt lat="46.889680000" lon="7.309920000">
- <name>Flamatt</name>
- <cmt>Flamatt</cmt>
- <desc>Flamatt</desc>
- </wpt>
- <wpt lat="47.063340000" lon="7.334350000">
- <name>TR Suberg</name>
- <cmt>TR Suberg</cmt>
- <desc>TR Suberg</desc>
- </wpt>
- <wpt lat="46.995210000" lon="7.351090000">
- <name>Trocknung Säriswi</name>
- <cmt>Trocknung Säriswi</cmt>
- <desc>Trocknung Säriswi</desc>
- </wpt>
- <wpt lat="47.044490000" lon="7.362040000">
- <name>Mühle Affolter</name>
- <cmt>Mühle Affolter</cmt>
- <desc>Mühle Affolter</desc>
- </wpt>
- <wpt lat="47.385370000" lon="7.362470000">
- <name>Silo Soyhieres</name>
- <cmt>Silo Soyhieres</cmt>
- <desc>Silo Soyhieres</desc>
- </wpt>
- <wpt lat="46.962100000" lon="7.382150000">
- <name>Mühle Augsburger</name>
- <cmt>Mühle Augsburger</cmt>
- <desc>Mühle Augsburger</desc>
- </wpt>
- <wpt lat="46.935950000" lon="7.392360000">
- <name>Schenk AG Bümpliz</name>
- <cmt>Schenk AG Bümpliz</cmt>
- <desc>Schenk AG Bümpliz</desc>
- </wpt>
- <wpt lat="47.041160000" lon="7.392460000">
- <name>Meier Motoren</name>
- <cmt>Meier Motoren</cmt>
- <desc>Meier Motoren</desc>
- </wpt>
- <wpt lat="46.902400000" lon="7.399590000">
- <name>Mühle Gasel</name>
- <cmt>Mühle Gasel</cmt>
- <desc>Mühle Gasel</desc>
- </wpt>
- <wpt lat="46.953150000" lon="7.481750000">
- <name>Schenk AG</name>
- <cmt>Schenk AG</cmt>
- <desc>Schenk AG</desc>
- </wpt>
- <wpt lat="46.650370000" lon="7.704080000">
- <name>11347 Däpp Lama</name>
- <cmt>11347 Däpp Lama</cmt>
- <desc>11347 Däpp Lama</desc>
- </wpt>
- <wpt lat="46.791390000" lon="7.518490000">
- <name>Grastrocknungsanlage Burgistein</name>
- <cmt>Grastrocknungsanlage Burgistein</cmt>
- <desc>Grastrocknungsanlage Burgistein</desc>
- </wpt>
- <wpt lat="46.878240000" lon="7.572920000">
- <name>20254 Strahm Mühle AG</name>
- <cmt>20254 Strahm Mühle AG</cmt>
- <desc>20254 Strahm Mühle AG</desc>
- </wpt>
- <wpt lat="46.904890000" lon="7.718770000">
- <name>Jordi Mühle</name>
- <cmt>Jordi Mühle</cmt>
- <desc>Jordi Mühle</desc>
- </wpt>
- <wpt lat="46.948640000" lon="7.747870000">
- <name>Saatzucht Emmenmat</name>
- <cmt>Saatzucht Emmenmat</cmt>
- <desc>Saatzucht Emmenmat</desc>
- </wpt>
- <wpt lat="46.957660000" lon="7.751280000">
- <name>Steiner Zollbr</name>
- <cmt>Steiner Zollbr</cmt>
- <desc>Steiner Zollbr</desc>
- </wpt>
- <wpt lat="46.969090000" lon="7.496190000">
- <name>Walther Mühle</name>
- <cmt>Walther Mühle</cmt>
- <desc>Walther Mühle</desc>
- </wpt>
- <wpt lat="46.986490000" lon="7.692880000">
- <name>Hess Mühle Schwanden</name>
- <cmt>Hess Mühle Schwanden</cmt>
- <desc>Hess Mühle Schwanden</desc>
- </wpt>
- <wpt lat="47.065800000" lon="7.610240000">
- <name>Papiersäcke Sommer Rindlis</name>
- <cmt>Papiersäcke Sommer Rindlis</cmt>
- <desc>Papiersäcke Sommer Rindlis</desc>
- </wpt>
- <wpt lat="47.073150000" lon="7.591840000">
- <name>Saatgutzent Lyssach</name>
- <cmt>Saatgutzent Lyssach</cmt>
- <desc>Saatgutzent Lyssach</desc>
- </wpt>
- <wpt lat="47.116820000" lon="7.617750000">
- <name>Krähenbühl Walter</name>
- <cmt>Krähenbühl Walter</cmt>
- <desc>Krähenbühl Walter</desc>
- </wpt>
- <wpt lat="47.163740000" lon="7.527390000">
- <name>Lagerhaus Lohn</name>
- <cmt>Lagerhaus Lohn</cmt>
- <desc>Lagerhaus Lohn</desc>
- </wpt>
- <wpt lat="47.208170000" lon="7.617250000">
- <name>Kofmehl Mühle</name>
- <cmt>Kofmehl Mühle</cmt>
- <desc>Kofmehl Mühle</desc>
- </wpt>
- <wpt lat="47.213900000" lon="7.756060000">
- <name>Erbo Agro</name>
- <cmt>Erbo Agro</cmt>
- <desc>Erbo Agro</desc>
- </wpt>
- <wpt lat="47.217370000" lon="7.783760000">
- <name>Geiser Agro Langenthal</name>
- <cmt>Geiser Agro Langenthal</cmt>
- <desc>Geiser Agro Langenthal</desc>
- </wpt>
- <wpt lat="47.218190000" lon="7.782420000">
- <name>Samen Steffen (Geiser)</name>
- <cmt>Samen Steffen (Geiser)</cmt>
- <desc>Samen Steffen (Geiser)</desc>
- </wpt>
- <wpt lat="47.252420000" lon="7.819840000">
- <name>Lorze AG Roggwil</name>
- <cmt>Lorze AG Roggwil</cmt>
- <desc>Lorze AG Roggwil</desc>
- </wpt>
- <wpt lat="47.258940000" lon="7.658650000">
- <name>Marstall</name>
- <cmt>Marstall</cmt>
- <desc>Marstall</desc>
- </wpt>
- <wpt lat="47.347490000" lon="7.900000000">
- <name>Hammermühle Olten</name>
- <cmt>Hammermühle Olten</cmt>
- <desc>Hammermühle Olten</desc>
- </wpt>
- <wpt lat="47.362560000" lon="7.915580000">
- <name>Silo Olten</name>
- <cmt>Silo Olten</cmt>
- <desc>Silo Olten</desc>
- </wpt>
- <wpt lat="47.480320000" lon="7.576790000">
- <name>Merian Schlatthof</name>
- <cmt>Merian Schlatthof</cmt>
- <desc>Merian Schlatthof</desc>
- </wpt>
- <wpt lat="47.503910000" lon="7.540760000">
- <name>12231 Genossensch Agrico</name>
- <cmt>12231 Genossensch Agrico</cmt>
- <desc>12231 Genossensch Agrico</desc>
- </wpt>
- <wpt lat="47.528660000" lon="8.261100000">
- <name>Muehle Muehlebach Wuerenlingen</name>
- <cmt>Muehle Muehlebach Wuerenlingen</cmt>
- <desc>Muehle Muehlebach Wuerenlingen</desc>
- </wpt>
- <wpt lat="47.536380000" lon="7.637640000">
- <name>Florin AG Muttenz</name>
- <cmt>Florin AG Muttenz</cmt>
- <desc>Florin AG Muttenz</desc>
- </wpt>
- <wpt lat="47.540680000" lon="7.737540000">
- <name>Provimi Kaiseraugst</name>
- <cmt>Provimi Kaiseraugst</cmt>
- <desc>Provimi Kaiseraugst</desc>
- </wpt>
- <wpt lat="47.540740000" lon="7.659770000">
- <name>Ultra Brag Auhafenstr 4</name>
- <cmt>Ultra Brag Auhafenstr 4</cmt>
- <desc>Ultra Brag Auhafenstr 4</desc>
- </wpt>
- <wpt lat="47.544970000" lon="7.991540000">
- <name>Trocknungsge.Eiken</name>
- <cmt>Trocknungsge.Eiken</cmt>
- <desc>Trocknungsge.Eiken</desc>
- </wpt>
-</gpx>
+++ /dev/null
- TomTom Navigator Places of Interest\r
- GPSBabel- ASCII Export\r
- Points\r
- Created at: Thu Jan 01 00:00:00 1970\r
--71.119277,42.438878,"5066"\r
--71.119689,42.439227,"5067"\r
--71.116146,42.438917,"5096"\r
--71.122044,42.443904,"5142"\r
--71.121447,42.447298,"5156"\r
--71.125094,42.454873,"5224"\r
--71.124988,42.459079,"5229"\r
--71.124474,42.456979,"5237"\r
--71.120990,42.454401,"5254"\r
--71.121746,42.451442,"5258"\r
--71.120660,42.454404,"5264"\r
--71.121045,42.457761,"526708"\r
--71.120313,42.457089,"526750"\r
--71.119676,42.456592,"527614"\r
--71.119356,42.456252,"527631"\r
--71.119135,42.458148,"5278"\r
--71.117693,42.459377,"5289"\r
--71.119828,42.464183,"5374FIRE"\r
--71.119399,42.465650,"5376"\r
--71.114456,42.439018,"6006"\r
--71.114803,42.438594,"6006BLUE"\r
--71.113223,42.436757,"6014MEADOW"\r
--71.113220,42.441754,"6029"\r
--71.109075,42.436243,"6053"\r
--71.107500,42.439250,"6066"\r
--71.107582,42.439764,"6067"\r
--71.105874,42.434766,"6071"\r
--71.106599,42.433304,"6073"\r
--71.104772,42.437338,"6084"\r
--71.110975,42.442196,"6130"\r
--71.111441,42.442981,"6131"\r
--71.108882,42.444773,"6153"\r
--71.106301,42.443592,"6171"\r
--71.106624,42.447804,"6176"\r
--71.106158,42.448448,"6177"\r
--71.106783,42.453415,"6272"\r
--71.107253,42.453434,"6272"\r
--71.106771,42.458298,"6278"\r
--71.105413,42.451430,"6280"\r
--71.105206,42.453845,"6283"\r
--71.106170,42.459986,"6289"\r
--71.105116,42.457616,"6297"\r
--71.113574,42.467110,"6328"\r
--71.109863,42.464202,"6354"\r
--71.110067,42.466459,"635722"\r
--71.109410,42.466557,"635783"\r
--71.107117,42.463495,"6373"\r
--71.110241,42.401051,"6634"\r
--71.106532,42.432621,"6979"\r
--71.107883,42.431033,"6997"\r
--71.107360,42.465687,"BEAR HILL"\r
--71.107628,42.430950,"BELLEVUE"\r
--71.114079,42.438666,"6016"\r
--71.124651,42.456469,"5236BRIDGE"\r
--71.119815,42.465759,"5376BRIDGE"\r
--71.105878,42.442993,"6181CROSS"\r
--71.109664,42.435472,"6042CROSS"\r
--71.103646,42.458516,"DARKHOLLPO"\r
--71.112675,42.443109,"6121DEAD"\r
--71.119298,42.449866,"5179DEAD"\r
--71.116524,42.459629,"5299DEAD"\r
--71.119148,42.465485,"5376DEAD"\r
--71.109986,42.462776,"6353DEAD"\r
--71.108784,42.446793,"6155DEAD"\r
--71.126602,42.451204,"GATE14"\r
--71.122078,42.458499,"GATE16"\r
--71.119238,42.459376,"GATE17"\r
--71.119240,42.466353,"GATE19"\r
--71.107697,42.468655,"GATE21"\r
--71.102973,42.456718,"GATE24"\r
--71.107690,42.430847,"GATE5"\r
--71.109236,42.431240,"GATE6"\r
--71.106556,42.439502,"6077LOGS"\r
--71.122320,42.449765,"5148NANEPA"\r
--71.119845,42.457388,"5267OBSTAC"\r
--71.109942,42.434980,"PANTHRCAVE"\r
--71.121211,42.453256,"5252PURPLE"\r
--71.117481,42.457734,"5287WATER"\r
--71.124574,42.459278,"5239ROAD"\r
--71.118991,42.458782,"5278ROAD"\r
--71.120925,42.439993,"5058ROAD"\r
--71.106782,42.453415,"SHEEPFOLD"\r
--71.107483,42.455956,"SOAPBOX"\r
--71.119328,42.465913,"5376STREAM"\r
--71.122845,42.445359,"5144SUMMIT"\r
--71.121676,42.441727,"5150TANK"\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<overlays>
- <overlay version="1.0">
- <center x="670866" y="212782"/>
- <shapes>
- <shape type="waypoint" name="002" comment="002" icon="Waypoint">
- <points>
- <point x="675012" y="211140"/>
- </points>
- </shape>
- <shape type="waypoint" name="012" comment="012" icon="Waypoint">
- <points>
- <point x="676012" y="214355"/>
- </points>
- </shape>
- <shape type="waypoint" name="015" comment="015" icon="Waypoint">
- <points>
- <point x="676153" y="214968"/>
- </points>
- </shape>
- <shape type="waypoint" name="017" comment="017" icon="Waypoint">
- <points>
- <point x="676130" y="214978"/>
- </points>
- </shape>
- <shape type="waypoint" name="019" comment="019" icon="Waypoint">
- <points>
- <point x="675700" y="215263"/>
- </points>
- </shape>
- <shape type="waypoint" name="020" comment="020" icon="Waypoint">
- <points>
- <point x="675681" y="215206"/>
- </points>
- </shape>
- <shape type="waypoint" name="021" comment="021" icon="Waypoint">
- <points>
- <point x="675635" y="215224"/>
- </points>
- </shape>
- <shape type="waypoint" name="041" comment="041" icon="Waypoint">
- <points>
- <point x="669202" y="210721"/>
- </points>
- </shape>
- <shape type="waypoint" name="044" comment="044" icon="Waypoint">
- <points>
- <point x="668394" y="211749"/>
- </points>
- </shape>
- <shape type="waypoint" name="047" comment="047" icon="Waypoint">
- <points>
- <point x="668377" y="211768"/>
- </points>
- </shape>
- <shape type="waypoint" name="056" comment="056" icon="Waypoint">
- <points>
- <point x="666154" y="211394"/>
- </points>
- </shape>
- <shape type="waypoint" name="060" comment="060" icon="Waypoint">
- <points>
- <point x="666130" y="210903"/>
- </points>
- </shape>
- <shape type="waypoint" name="062" comment="062" icon="Waypoint">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" name="065" comment="065" icon="Waypoint">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" name="068" comment="068" icon="Waypoint">
- <points>
- <point x="666121" y="210898"/>
- </points>
- </shape>
- <shape type="waypoint" name="073" comment="073" icon="Waypoint">
- <points>
- <point x="665720" y="210598"/>
- </points>
- </shape>
- <shape type="waypoint" name="074" comment="074" icon="Waypoint">
- <points>
- <point x="665579" y="210300"/>
- </points>
- </shape>
- <shape type="polyline" lineSize="3" lineColor="#e60000" lineStyle="solid">
- <waypoints>
- <shape type="waypoint" timestamp="2007-08-21T18:37:58Z">
- <points>
- <point x="675012" y="211140"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:37:59Z">
- <points>
- <point x="676012" y="214355"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:00Z">
- <points>
- <point x="676153" y="214968"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:01Z">
- <points>
- <point x="676130" y="214978"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:02Z">
- <points>
- <point x="675700" y="215263"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:03Z">
- <points>
- <point x="675681" y="215206"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:04Z">
- <points>
- <point x="675635" y="215224"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:05Z">
- <points>
- <point x="669202" y="210721"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:06Z">
- <points>
- <point x="668394" y="211749"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:07Z">
- <points>
- <point x="668377" y="211768"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:08Z">
- <points>
- <point x="666154" y="211394"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:09Z">
- <points>
- <point x="666130" y="210903"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:10Z">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:11Z">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:12Z">
- <points>
- <point x="666121" y="210898"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:13Z">
- <points>
- <point x="665720" y="210598"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:14Z">
- <points>
- <point x="665579" y="210300"/>
- </points>
- </shape>
- </waypoints>
- </shape>
- </shapes>
- </overlay>
-</overlays>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
- <time>1970-01-01T00:00:00Z</time>
- <bounds minlat="47.040493413" minlon="8.301538728" maxlat="47.084053769" maxlon="8.441445336"/>
- <wpt lat="47.047048679" lon="8.425787728">
- <name>002</name>
- <cmt>002</cmt>
- <desc>002</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.075851301" lon="8.439485848">
- <name>012</name>
- <cmt>012</cmt>
- <desc>012</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.081348565" lon="8.441445336">
- <name>015</name>
- <cmt>015</cmt>
- <desc>015</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.081441150" lon="8.441144177">
- <name>017</name>
- <cmt>017</cmt>
- <desc>017</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.084053769" lon="8.435530024">
- <name>019</name>
- <cmt>019</cmt>
- <desc>019</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.083543270" lon="8.435270306">
- <name>020</name>
- <cmt>020</cmt>
- <desc>020</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.083710418" lon="8.434667607">
- <name>021</name>
- <cmt>021</cmt>
- <desc>021</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.043911888" lon="8.349271355">
- <name>041</name>
- <cmt>041</cmt>
- <desc>041</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.053241978" lon="8.338794823">
- <name>044</name>
- <cmt>044</cmt>
- <desc>044</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.053414625" lon="8.338573965">
- <name>047</name>
- <cmt>047</cmt>
- <desc>047</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.050276242" lon="8.309263802">
- <name>056</name>
- <cmt>056</cmt>
- <desc>056</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.045862359" lon="8.308876328">
- <name>060</name>
- <cmt>060</cmt>
- <desc>060</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.045734441" lon="8.309137456">
- <name>062</name>
- <cmt>062</cmt>
- <desc>062</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.045734441" lon="8.309137456">
- <name>065</name>
- <cmt>065</cmt>
- <desc>065</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.045818284" lon="8.308757172">
- <name>068</name>
- <cmt>068</cmt>
- <desc>068</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.043159808" lon="8.303437100">
- <name>073</name>
- <cmt>073</cmt>
- <desc>073</desc>
- <sym>Waypoint</sym>
- </wpt>
- <wpt lat="47.040493413" lon="8.301538728">
- <name>074</name>
- <cmt>074</cmt>
- <desc>074</desc>
- <sym>Waypoint</sym>
- </wpt>
- <trk>
- <trkseg>
- <trkpt lat="47.047048679" lon="8.425787728">
- <time>2007-08-21T18:37:58Z</time>
- </trkpt>
- <trkpt lat="47.075851301" lon="8.439485848">
- <time>2007-08-21T18:37:59Z</time>
- </trkpt>
- <trkpt lat="47.081348565" lon="8.441445336">
- <time>2007-08-21T18:38:00Z</time>
- </trkpt>
- <trkpt lat="47.081441150" lon="8.441144177">
- <time>2007-08-21T18:38:01Z</time>
- </trkpt>
- <trkpt lat="47.084053769" lon="8.435530024">
- <time>2007-08-21T18:38:02Z</time>
- </trkpt>
- <trkpt lat="47.083543270" lon="8.435270306">
- <time>2007-08-21T18:38:03Z</time>
- </trkpt>
- <trkpt lat="47.083710418" lon="8.434667607">
- <time>2007-08-21T18:38:04Z</time>
- </trkpt>
- <trkpt lat="47.043911888" lon="8.349271355">
- <time>2007-08-21T18:38:05Z</time>
- </trkpt>
- <trkpt lat="47.053241978" lon="8.338794823">
- <time>2007-08-21T18:38:06Z</time>
- </trkpt>
- <trkpt lat="47.053414625" lon="8.338573965">
- <time>2007-08-21T18:38:07Z</time>
- </trkpt>
- <trkpt lat="47.050276242" lon="8.309263802">
- <time>2007-08-21T18:38:08Z</time>
- </trkpt>
- <trkpt lat="47.045862359" lon="8.308876328">
- <time>2007-08-21T18:38:09Z</time>
- </trkpt>
- <trkpt lat="47.045734441" lon="8.309137456">
- <time>2007-08-21T18:38:10Z</time>
- </trkpt>
- <trkpt lat="47.045734441" lon="8.309137456">
- <time>2007-08-21T18:38:11Z</time>
- </trkpt>
- <trkpt lat="47.045818284" lon="8.308757172">
- <time>2007-08-21T18:38:12Z</time>
- </trkpt>
- <trkpt lat="47.043159808" lon="8.303437100">
- <time>2007-08-21T18:38:13Z</time>
- </trkpt>
- <trkpt lat="47.040493413" lon="8.301538728">
- <time>2007-08-21T18:38:14Z</time>
- </trkpt>
- </trkseg>
- </trk>
-</gpx>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<overlays>
- <overlay version="1.0">
- <center x="670867" y="212782"/>
- <shapes>
- <shape type="waypoint" name="002" icon="Waypoint">
- <points>
- <point x="675012" y="211140"/>
- </points>
- </shape>
- <shape type="waypoint" name="012" icon="Waypoint">
- <points>
- <point x="676012" y="214355"/>
- </points>
- </shape>
- <shape type="waypoint" name="015" icon="Waypoint">
- <points>
- <point x="676153" y="214968"/>
- </points>
- </shape>
- <shape type="waypoint" name="017" icon="Waypoint">
- <points>
- <point x="676130" y="214978"/>
- </points>
- </shape>
- <shape type="waypoint" name="019" icon="Waypoint">
- <points>
- <point x="675700" y="215263"/>
- </points>
- </shape>
- <shape type="waypoint" name="020" icon="Waypoint">
- <points>
- <point x="675681" y="215206"/>
- </points>
- </shape>
- <shape type="waypoint" name="021" icon="Waypoint">
- <points>
- <point x="675635" y="215224"/>
- </points>
- </shape>
- <shape type="waypoint" name="041" icon="Waypoint">
- <points>
- <point x="669202" y="210721"/>
- </points>
- </shape>
- <shape type="waypoint" name="044" icon="Waypoint">
- <points>
- <point x="668394" y="211749"/>
- </points>
- </shape>
- <shape type="waypoint" name="047" icon="Waypoint">
- <points>
- <point x="668377" y="211768"/>
- </points>
- </shape>
- <shape type="waypoint" name="056" icon="Waypoint">
- <points>
- <point x="666154" y="211394"/>
- </points>
- </shape>
- <shape type="waypoint" name="060" icon="Waypoint">
- <points>
- <point x="666130" y="210903"/>
- </points>
- </shape>
- <shape type="waypoint" name="062" icon="Waypoint">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" name="065" icon="Waypoint">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" name="068" icon="Waypoint">
- <points>
- <point x="666121" y="210898"/>
- </points>
- </shape>
- <shape type="waypoint" name="073" icon="Waypoint">
- <points>
- <point x="665720" y="210598"/>
- </points>
- </shape>
- <shape type="waypoint" name="074" icon="Waypoint">
- <points>
- <point x="665579" y="210300"/>
- </points>
- </shape>
- <shape type="polyline" lineSize="3" lineColor="#e60000" lineStyle="solid">
- <waypoints>
- <shape type="waypoint" timestamp="2007-08-21T18:37:58Z">
- <points>
- <point x="675012" y="211140"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:37:59Z">
- <points>
- <point x="676012" y="214355"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:00Z">
- <points>
- <point x="676153" y="214968"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:01Z">
- <points>
- <point x="676130" y="214978"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:02Z">
- <points>
- <point x="675700" y="215263"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:03Z">
- <points>
- <point x="675681" y="215206"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:04Z">
- <points>
- <point x="675635" y="215224"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:05Z">
- <points>
- <point x="669202" y="210721"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:06Z">
- <points>
- <point x="668394" y="211749"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:07Z">
- <points>
- <point x="668377" y="211768"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:08Z">
- <points>
- <point x="666154" y="211394"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:09Z">
- <points>
- <point x="666130" y="210903"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:10Z">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:11Z">
- <points>
- <point x="666150" y="210889"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:12Z">
- <points>
- <point x="666121" y="210898"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:13Z">
- <points>
- <point x="665720" y="210598"/>
- </points>
- </shape>
- <shape type="waypoint" timestamp="2007-08-21T18:38:14Z">
- <points>
- <point x="665579" y="210300"/>
- </points>
- </shape>
- </waypoints>
- </shape>
- </shapes>
- </overlay>
-</overlays>
+++ /dev/null
-#
-# (c) 2006, Robert Lipe, based on sample files by Krzysztof Wojtas
-# Reference info: http://www.seeyou.ws/thankyou.php?fname=cup_format.pdf
-# Reference info: http://download.naviter.com/docs/cup_format.pdf
-# Reference info: http://www.keepitsoaring.com/LKSC/Downloads/cup_format.pdf
-#
-
-DESCRIPTION See You flight analysis data
-SHORTLEN 8
-EXTENSION cup
-#
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER COMMA
-RECORD_DELIMITER NEWLINE
-BADCHARS ,"
-PROLOGUE name,code,country,lat,lon,elev,style,rwdir,rwlen,freq,desc
-EPILOGUE -----Related Tasks-----
-
-
-IFIELD IGNORE,"", ""%s""
-IFIELD SHORTNAME,"", "%s"
-IFIELD CONSTANT,"", ""
-IFIELD LAT_DDMMDIR, "%f", "%08.3f", "absolute"
-IFIELD LON_DDMMDIR, "%f", "%09.3f", "absolute"
-IFIELD ALT_METERS,"", "%dm"
-IFIELD CONSTANT,"", "1"
-IFIELD CONSTANT,"", ""
-IFIELD CONSTANT,"", ""
-IFIELD CONSTANT,"", ""
-IFIELD DESCRIPTION,"", ""%s""
-
-OFIELD SHORTNAME,"", ""%s""
-OFIELD SHORTNAME,"", "%s"
-OFIELD CONSTANT,"", ""
-OFIELD LAT_DDMMDIR, "", "%08.3f%c"
-OFIELD LON_DDMMDIR, "", "%09.3f%c"
-OFIELD ALT_METERS,"", "%3.1fm"
-OFIELD CONSTANT,"", "1"
-OFIELD CONSTANT,"", ""
-OFIELD CONSTANT,"", ""
-OFIELD CONSTANT,"", ""
-OFIELD DESCRIPTION,"", ""%s""
-
-
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: DNA Marker Format
-# Author: Alex Mottram
-# Date: 12/09/2002
-#
-#
-# As defined in dna.c
-#
-#
-
-DESCRIPTION Navitrak DNA marker format
-EXTENSION dna
-
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER COMMA
-RECORD_DELIMITER NEWLINE
-BADCHARS COMMA
-
-#
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-#
-IFIELD INDEX, "", "%d"
-IFIELD LAT_DECIMAL, "", "%08.5f"
-IFIELD LON_DECIMAL, "", "%08.5f"
-IFIELD DESCRIPTION, "", "%s"
-
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: NIMA/GNIS Geographic Names File
-# Author: Alex Mottram
-# Date: 11/24/2002
-#
-
-DESCRIPTION NIMA/GNIS Geographic Names File
-
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER TAB
-RECORD_DELIMITER NEWLINE
-BADCHARS TAB
-PROLOGUE RC UFI UNI DD_LAT DD_LONG DMS_LAT DMS_LONG UTM JOG FC DSG PC CC1 ADM1 ADM2 DIM CC2 NT LC SHORT_FORM GENERIC SORT_NAME FULL_NAME FULL_NAME_ND MODIFY_DATE
-
-#
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-#
-IFIELD IGNORE, "", "%s" # RC
-IFIELD IGNORE, "", "%s" # UFI
-IFIELD IGNORE, "", "%s" # UNI
-IFIELD LAT_DECIMAL, "", "%f" # DD_LAT
-IFIELD LON_DECIMAL, "", "%f" # DD_LON
-IFIELD IGNORE, "", "%s" # DMS_LAT
-IFIELD IGNORE, "", "%s" # DMS_LON
-IFIELD IGNORE, "", "%s" # UTM
-IFIELD IGNORE, "", "%s" # JOG
-IFIELD IGNORE, "", "%s" # FC
-IFIELD IGNORE, "", "%s" # DSG
-IFIELD IGNORE, "", "%s" # PC
-IFIELD IGNORE, "", "%s" # CC1
-IFIELD IGNORE, "", "%s" # ADM1
-IFIELD IGNORE, "", "%s" # ADM2
-IFIELD IGNORE, "", "%s" # DIM
-IFIELD IGNORE, "", "%s" # CC2
-IFIELD IGNORE, "", "%s" # NT
-IFIELD IGNORE, "", "%s" # LC
-IFIELD IGNORE, "", "%s" # SHORT_FORM
-IFIELD IGNORE, "", "%s" # GENERIC
-IFIELD SHORTNAME, "", "%s" # SORT_NAME
-IFIELD IGNORE, "", "%s" # FULL_NAME (unicoded!)
-IFIELD DESCRIPTION, "", "%s" # FULL_NAME_ND
-IFIELD IGNORE, "", "%s" # MODIFY_DATE
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: MS S&T 2002/2003
-# Author: Alex Mottram
-# Date: 12/09/2002
-#
-#
-# As requested by Noel Shrum on the gpsbabel-code mailing list.
-# Name,Latitude,Longitude,Name 2,URL,Type
-# GCCBF,44.479133,-85.56515,High Rollaway by rjlint,http://www.geocaching.com/seek/cache_details.aspx?ID=3263,Traditional Cache
-# GC110D,44.6522,-85.492483,Brown Bridge Pond Peek-a-Boo Cache by Big Bird,http://www.geocaching.com/seek/cache_details.aspx?ID=4365,Traditional Cache
-# GC171C,44.70605,-85.62265,The Michigan Frog by RealDcoy & LRB,http://www.geocaching.com/seek/cache_details.aspx?ID=5916,Traditional Cache
-#
-
-DESCRIPTION Microsoft Streets and Trips 2002-2007
-EXTENSION txt
-
-
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER TAB
-RECORD_DELIMITER NEWLINE
-BADCHARS ,"
-
-PROLOGUE Name Latitude Longitude Description URL Type Container Diff Terr
-
-#
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-# NOTE: MS S&T ONLY IMPORTS DATA, IT DOESN'T EXPORT THIS ANYWHERE SO WE CAN
-# HAVE OUR WAY WITH THE FORMATTING.
-#
-IFIELD SHORTNAME, "", "%s" # Name
-IFIELD LAT_DECIMAL, "", "%f" # Latitude
-IFIELD LON_DECIMAL, "", "%f" # Longitude
-IFIELD DESCRIPTION, "", "%s" # Name 2 (Big Description)
-IFIELD URL, "", "%s" # URL
-IFIELD GEOCACHE_TYPE, "", "%s" # Geocache Type
-IFIELD GEOCACHE_CONTAINER, "", "%s" # Geocache Type
-IFIELD GEOCACHE_DIFF, "", "%3.1f" # Geocache Type
-IFIELD GEOCACHE_TERR, "", "%3.1f" # Geocache Type
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: TomTom Navigator Places of Interest
-# Author: Olaf Klein
-# Date: 04/17/2007
-#
-DESCRIPTION TomTom POI file (.asc)
-EXTENSION asc
-DATATYPE WAYPOINT
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER COMMA
-RECORD_DELIMITER CRNEWLINE
-BADCHARS ,"
-ENCODING windows-1252
-#
-PROLOGUE TomTom Navigator Places of Interest
-PROLOGUE GPSBabel-__VERSION__ ASCII Export
-PROLOGUE Points
-PROLOGUE Created at: __DATE_AND_TIME__
-# #
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-#
-IFIELD LON_DECIMAL, "", "%.6f"
-IFIELD LAT_DECIMAL, "", "%.6f"
-IFIELD SHORTNAME, "", ""%s""
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: TomTom Navigator Itineraries (Routes)
-# Author: Olaf Klein
-# Date: 04/17/2007
-#
-DESCRIPTION TomTom Itineraries (.itn)
-EXTENSION itn
-DATATYPE ROUTE
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER PIPE
-RECORD_DELIMITER CRNEWLINE
-BADCHARS ,|
-ENCODING windows-1252
-#
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-#
-IFIELD LON_10E5, "", "%.0f"
-IFIELD LAT_10E5, "", "%.0f"
-IFIELD SHORTNAME, "", "%s"
-IFIELD CONSTANT, "0", "%s"
+++ /dev/null
-# gpsbabel XCSV style file
-#
-# Format: TomTom Navigator Itineraries (Routes)
-# Author: Olaf Klein
-# Date: 04/17/2007
-#
-DESCRIPTION TomTom Places Itineraries (.itn)
-EXTENSION itn
-DATATYPE ROUTE
-#
-# FILE LAYOUT DEFINITIIONS:
-#
-FIELD_DELIMITER PIPE
-RECORD_DELIMITER CRNEWLINE
-BADCHARS ,|
-ENCODING windows-1252
-#
-# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
-#
-IFIELD LON_10E5, "", "%.f"
-IFIELD LAT_10E5, "", "%.f"
-IFIELD SHORTNAME, "", "%s"
-IFIELD CONSTANT, "2", "%s"
+++ /dev/null
-/*
- Support for XML based "TourExchangeFormat",
- found in Map & Guide Motorrad-Tourenplaner 2005/06
-
- Copyright (C) 2005 Olaf Klein, o.b.klein@gpsbabel.org
-
- Based on kml.c, Keyhole "kml" format.
- Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-*/
-
-#include "tef_xml.h"
-
-#include <QLatin1String> // for QLatin1String
-#include <QString> // for QString, QStringView::toString
-#include <QXmlStreamAttribute> // for QXmlStreamAttribute
-#include <QXmlStreamAttributes> // for QXmlStreamAttributes
-#include <Qt> // for CaseInsensitive
-
-#include <type_traits> // for add_const<>::type
-
-#include "defs.h" // for Waypoint, fatal, wp_flags, route_add_head, route_add_wpt, route_head, waypt_add
-#include "xmlgeneric.h" // for xg_string, build_xg_tag_map, xml_deinit, xml_init, xml_read
-
-
-#define MYNAME "TourExchangeFormat"
-
-/*
- * tef_start: check for comment "TourExchangeFormat"
- */
-
-void
-TefXMLFormat::tef_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
-{
- bool valid = false;
-
- for (const auto& attr : *attrv) {
- if (attr.name().compare(QLatin1String("Comment"), Qt::CaseInsensitive) == 0) {
- if (attr.value().compare(QLatin1String("TourExchangeFormat"), Qt::CaseInsensitive) == 0) {
- valid = true;
- }
- } else if (attr.name().compare(QLatin1String("Version"), Qt::CaseInsensitive) == 0) {
- version = attr.value().toDouble();
- }
- }
-
- if (!valid) {
- fatal(MYNAME ": Error in source file.\n");
- }
-}
-
-/*
- * tef_header: "Name" > Route name, "Software" > Route descr.
- */
-
-void
-TefXMLFormat::tef_header(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
-{
- route = new route_head;
- for (const auto& attr : *attrv) {
- if (attr.name().compare(QLatin1String("Name"), Qt::CaseInsensitive) == 0) {
- route->rte_name = attr.value().toString().trimmed();
- } else if (attr.name().compare(QLatin1String("Software"), Qt::CaseInsensitive) == 0) {
- route->rte_desc = attr.value().toString().trimmed();
- }
- }
- route_add_head(route);
-}
-
-void
-TefXMLFormat::tef_list_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
-{
- if (attrv->hasAttribute("ItemCount")) {
- item_count = attrv->value("ItemCount").toUInt();
- }
-}
-
-#if OMG
-
-/*
- * TODO: this whole horrible mess is not covered at all in the test suite,
- * so just stub it all out until someone cares. (TEF is rarely used from
- * what we can tell.)
- */
-
-
-/* in "TourExchangeFormat" the following can happen:
- *
- * SegDescription="L34\Wittlicher Strasse"
- * PointDescription="Wittlicher Strasse ( "
- *
- * fix_notes tries to create a new PointDescription, which
- * should be "Wittlicher Strasse (L34)" for the example above
- */
-// FIXME: the calling convention here is screwy. notes is an input AND
-// output argument and may be modified.
-char*
-TefXMLFormat::fix_notes(const char* name, char* notes)
-{
- const char* cleft, *cright, *cback;
- char* ctmp;
-
- if ((! name) || (! notes)) {
- return notes;
- }
-
- /* do we have a BACKSLASH in shortname ? */
- cback = strchr(name, '\\');
- if ((! cback) || (cback == name)) {
- return notes;
- }
-
- /* do we have left, but no right parenthesis in notes ? */
- if (!(cleft = strchr(notes, '('))) {
- return notes;
- }
- cright = strchr(notes, ')');
- if (cright && (cright > cleft)) {
- return notes;
- }
-
- /* now contruct the new name */
- ctmp = lrtrim(xstrndup(notes, cleft - notes));
- xfree(notes);
- xasprintf(¬es, "%s (%*.*s)", ctmp, (int)(cback - name), (int)(cback - name), name);
- xfree(ctmp);
-
- return notes;
-}
-
-char*
-TefXMLFormat::Xfix_notes(const QString& name, const QString& notes)
-{
-
- char* cname = xstrdup(name);
- char* cnotes = xstrdup(notes);
- char *r = fix_notes(cname, cnotes);
- xfree(cname);
-// WTH? fix_notes() modifies the note string...and
-// may reallocate it.
-// xfree(cnotes);
- return r;
-}
-#else
-QString
-TefXMLFormat::fix_notes(const QString& /*unused*/, const QString& notes){
- return notes;
-}
-#endif
-
-void
-TefXMLFormat::waypoint_final()
-{
- if (wpt_tmp == nullptr) {
- return;
- }
-
- int via = wpt_tmp->wpt_flags.fmt_use;
- wpt_tmp->wpt_flags.fmt_use = 0;
-
- if (version < 2) { /* keep the old behaviour */
- wpt_tmp->notes = wpt_tmp->description;
- wpt_tmp->description = QString();
- }
-
- wpt_tmp->notes = fix_notes(wpt_tmp->shortname, wpt_tmp->notes);
-
- if (via != 0) {
- waypt_add(wpt_tmp);
- }
-
- if (route != nullptr) {
- if ((via != 0) || (routevia == nullptr)) {
- auto* wpt = new Waypoint(*wpt_tmp);
- route_add_wpt(route, wpt);
- }
- }
-
- if (via == 0) {
- delete wpt_tmp;
- }
-
- wpt_tmp = nullptr;
-}
-
-void
-TefXMLFormat::tef_item_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/)
-{
- waypoint_final();
-}
-
-void
-TefXMLFormat::tef_list_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/)
-{
- waypoint_final();
- if (waypoints != item_count)
- fatal(MYNAME ": waypoint count differs to internal \"ItemCount\"! (%d to %d)\n",
- waypoints, item_count);
-}
-
-void
-TefXMLFormat::tef_item_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
-{
- waypoints++;
-
- wpt_tmp = new Waypoint;
- if ((waypoints == 1) || (waypoints == item_count)) {
- wpt_tmp->wpt_flags.fmt_use ++;
- }
-
- for (const auto& attr : *attrv) {
- QString attrstr = attr.value().toString();
-
- if (attr.name().compare(QLatin1String("SegDescription"), Qt::CaseInsensitive) == 0) {
- wpt_tmp->shortname = attrstr.trimmed();
- } else if (attr.name().compare(QLatin1String("PointDescription"), Qt::CaseInsensitive) == 0) {
- wpt_tmp->description = attrstr.trimmed();
- } else if (attr.name().compare(QLatin1String("ViaStation"), Qt::CaseInsensitive) == 0 &&
- attr.value().compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
- wpt_tmp->wpt_flags.fmt_use = 1; /* only a flag */
-
- /* new in TEF V2 */
- } else if (attr.name().compare(QLatin1String("Instruction"), Qt::CaseInsensitive) == 0) {
- wpt_tmp->description = attrstr.trimmed();
- } else if (attr.name().compare(QLatin1String("Altitude"), Qt::CaseInsensitive) == 0) {
- wpt_tmp->altitude = attrstr.toDouble();
- } else if (attr.name().compare(QLatin1String("TimeStamp"), Qt::CaseInsensitive) == 0) {
- /* nothing for the moment */
- }
- }
-}
-
-double
-TefXMLFormat::tef_read_comma_float(QStringView value)
-{
- QString svalue = value.toString();
-
- int cidx = svalue.indexOf(',');
- if (cidx == -1) {
- return svalue.toDouble();
- }
-
- QString fixed = svalue.replace(cidx, 1, '.');
- return fixed.toDouble();
-}
-
-void
-TefXMLFormat::tef_point(xg_string /*unused*/, const QXmlStreamAttributes* attrv)
-{
- if (!wpt_tmp) {
- return;
- }
-
- if (attrv->hasAttribute("y")) {
- wpt_tmp->latitude = tef_read_comma_float(attrv->value("y"));
- }
-
- if (attrv->hasAttribute("x")) {
- wpt_tmp->longitude = tef_read_comma_float(attrv->value("x"));
- }
-}
-
-void
-TefXMLFormat::rd_init(const QString& fname)
-{
- wpt_tmp = nullptr;
- waypoints = 0;
- item_count = -1;
- version = 1.5;
-
- xml_init(fname, build_xg_tag_map(this, tef_xml_map), nullptr, nullptr, nullptr, true);
-}
-
-void
-TefXMLFormat::read()
-{
- xml_read();
-}
-
-void
-TefXMLFormat::rd_deinit()
-{
- xml_deinit();
-}
+++ /dev/null
-/*
- Support for XML based "TourExchangeFormat",
- found in Map & Guide Motorrad-Tourenplaner 2005/06
-
- Copyright (C) 2005 Olaf Klein, o.b.klein@gpsbabel.org
-
- Based on kml.c, Keyhole "kml" format.
- Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-*/
-#ifndef TEF_XML_H_INCLUDED_
-#define TEF_XML_H_INCLUDED_
-
-#include <QList> // for QList
-#include <QString> // for QString
-#include <QStringView> // for QStringView
-#include <QVector> // for QVector
-#include <QXmlStreamAttributes> // for QXmlStreamAttributes
-
-#include "defs.h" // for arglist_t, ff_cap, ff_cap_none, ARGTYPE_BOOL, ARG_NOMINMAX, CET_CHARSET_UTF8, Waypoint, ff_cap_read, ff_type, ff_type_file, route_head
-#include "format.h" // for Format
-#include "xmlgeneric.h" // for xg_functor_map_entry, xg_string, cb_start, cb_end
-
-
-class TefXMLFormat : public Format
-{
-public:
- QVector<arglist_t>* get_args() override
- {
- return &tef_xml_args;
- }
-
- ff_type get_type() const override
- {
- return ff_type_file;
- }
-
- QVector<ff_cap> get_cap() const override
- {
- /* waypoints, tracks, routes */
- return { ff_cap_none, ff_cap_none, ff_cap_read };
- }
-
- QString get_encode() const override
- {
- return CET_CHARSET_UTF8;
- }
-
- int get_fixed_encode() const override
- {
- return 1;
- }
-
- void rd_init(const QString& fname) override;
- void read() override;
- void rd_deinit() override;
-
-private:
- /* Member Functions */
-
- static QString fix_notes(const QString& /*unused*/, const QString& notes);
- void waypoint_final();
- static double tef_read_comma_float(QStringView value);
- void tef_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
- void tef_header(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
- void tef_list_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
- void tef_item_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/);
- void tef_list_end(xg_string /*unused*/, const QXmlStreamAttributes* /*unused*/);
- void tef_item_start(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
- void tef_point(xg_string /*unused*/, const QXmlStreamAttributes* attrv);
-
- /* Data Members */
-
- Waypoint* wpt_tmp{};
- int item_count{};
- int waypoints{};
- double version{};
- route_head* route = nullptr;
-
- char* routevia = nullptr;
-
- QVector<arglist_t> tef_xml_args = {
- {
- "routevia", &routevia, "Include only via stations in route",
- nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
- }
- };
-
- QList<xg_functor_map_entry<TefXMLFormat>> tef_xml_map = {
- { &TefXMLFormat::tef_start, cb_start, "/TEF" },
- { &TefXMLFormat::tef_header, cb_start, "/TEF/Header" },
- { &TefXMLFormat::tef_list_start, cb_start, "/TEF/WaypointList" },
- { &TefXMLFormat::tef_item_start, cb_start, "/TEF/WaypointList/Item" },
- { &TefXMLFormat::tef_point, cb_start, "/TEF/WaypointList/Item/Point" },
- { &TefXMLFormat::tef_item_end, cb_end, "/TEF/WaypointList/Item" },
- { &TefXMLFormat::tef_list_end, cb_end, "/TEF/WaypointList" }
- };
-};
-#endif // TEF_XML_H_INCLUDED_
+++ /dev/null
-/*
-
- teletype .way module
-
- Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-#include "teletype.h"
-
-#include <cstdio> // for SEEK_CUR
-#include "defs.h" // for Waypoint, waypt_add
-
-
-#define MYNAME "teletype"
-
-
-/*******************************************************************************
-* %%% global callbacks called by gpsbabel main process %%% *
-*******************************************************************************/
-
-void
-TeletypeFormat::rd_init(const QString& fname)
-{
- char header[64];
-
- fin = gbfopen(fname, "r", MYNAME);
-
- gbfread(header, sizeof(header), 1, fin);
- tty_wpt_count = gbfgetint32(fin);
-}
-
-void
-TeletypeFormat::rd_deinit()
-{
- gbfclose(fin);
-}
-
-void
-TeletypeFormat::read()
-{
- for (uint32_t i = 0; i < tty_wpt_count; i++) {
- auto* wpt = new Waypoint;
- wpt->shortname = (gbfgetcstr(fin));
- wpt->description = (gbfgetcstr(fin));
-
- if (true) { // needs bit values of NEWFORMAT2
- uint32_t direction = gbfgetuint32(fin);
- uint32_t mins = gbfgetuint32(fin);
- (void) direction ;
- (void) mins ;
- }
-
- if (true) { // need bit value of NEWFORMAT
- int len = gbfgetuint16(fin);
- gbfseek(fin, len, SEEK_CUR);
- }
- wpt->latitude = gbfgetint32(fin) / 1000000.0 ;
- wpt->longitude = gbfgetint32(fin) / 1000000.0 ;
- gbfseek(fin, 21, SEEK_CUR);
-
- waypt_add(wpt);
- }
-}
+++ /dev/null
-/*
-
- teletype .way module
-
- Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-#ifndef TELETYPE_H_INCLUDED_
-#define TELETYPE_H_INCLUDED_
-
-#include <QString> // for QString
-#include <QVector> // for QVector
-
-#include <cstdint> // for uint32_t
-
-#include "defs.h" // for ff_cap, arglist_t, ff_cap_none, CET_CHARSET_ASCII, ff_cap_read, ff_type, ff_type_file
-#include "format.h" // for Format
-#include "gbfile.h" // for gbfile
-
-
-class TeletypeFormat : public Format
-{
-public:
- QVector<arglist_t>* get_args() override
- {
- return &teletype_args;
- }
-
- ff_type get_type() const override
- {
- return ff_type_file;
- }
-
- QVector<ff_cap> get_cap() const override
- {
- /* waypoints, tracks, routes */
- return {(ff_cap)(ff_cap_read), ff_cap_none, ff_cap_none};
- }
-
- QString get_encode() const override
- {
- return CET_CHARSET_ASCII;
- }
-
- int get_fixed_encode() const override
- {
- return 0;
- }
-
- void rd_init(const QString& fname) override;
- void read() override;
- void rd_deinit() override;
-
-private:
- /* Data Members */
-
- uint32_t tty_wpt_count{};
- gbfile* fin{};
-
- QVector<arglist_t> teletype_args = {
- };
-
-};
-#endif // TELETYPE_H_INCLUDED_
+++ /dev/null
-#
-# Digital Mapping Tracklogs
-#
-rm -f ${TMPDIR}/dmtlog*
-gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl
-gpsbabel -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx
-compare ${REFERENCE}/track/dmtlog-sample.gpx ${TMPDIR}/dmtlog-sample.gpx
-
+++ /dev/null
-
-# Navitrak DNA marker format
-gpsbabel -i dna -f ${REFERENCE}/dnatest.txt -o dna -F ${TMPDIR}/dnatest.txt
-compare ${REFERENCE}/dnatest.txt ${TMPDIR}/dnatest.txt
+++ /dev/null
-#
-# XAiOX iTrackU Logger
-#
-rm -f ${TMPDIR}/itracku.unicsv
-gpsbabel -w -i itracku-bin -f ${REFERENCE}/itracku.dat -o unicsv,utc=0 -F ${TMPDIR}/itracku.unicsv
-compare ${REFERENCE}/itracku.unicsv ${TMPDIR}/itracku.unicsv
-
+++ /dev/null
-#
-# Navitel Navigator binary tracks
-#
-gpsbabel -i gdb -f ${REFERENCE}/gdb-sample.gdb -o navitel_trk -F ${TMPDIR}/navitel_trk.bin
-bincompare ${REFERENCE}/track/navitel_trk.bin ${TMPDIR}/navitel_trk.bin
-gpsbabel -i navitel_trk -f ${REFERENCE}/track/navitel_trk.bin -o navitel_trk -F ${TMPDIR}/navitel_trk2.bin
-bincompare ${TMPDIR}/navitel_trk.bin ${TMPDIR}/navitel_trk2.bin
-
+++ /dev/null
-#
-# "Raymarine Waypoint File" tests
-#
-gpsbabel -i raymarine -f ${REFERENCE}/raymarine-sample.rwf -o gpx -F ${TMPDIR}/raymarine-sample.gpx
-compare ${REFERENCE}/raymarine-sample.gpx ${TMPDIR}/raymarine-sample.gpx
-gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o raymarine -F ${TMPDIR}/expertgps.rwf
-compare ${REFERENCE}/expertgps.rwf ${TMPDIR}/expertgps.rwf
+++ /dev/null
-#
-# Teletype tests
-#
-rm -f ${TMPDIR}/teletype.*
-gpsbabel -i teletype -f ${REFERENCE}/track/teletype.way -o gpx -F ${TMPDIR}/teletype.gpx
-compare ${REFERENCE}/track/teletype.gpx ${TMPDIR}/teletype.gpx
-
+++ /dev/null
-#
-# TomTom .ov2 tests
-#
-
-rm -f ${TMPDIR}/ov2.out
-gpsbabel -i arc -f ${REFERENCE}/google.arc -o tomtom -F ${TMPDIR}/ov2.out
-compare ${REFERENCE}/ov2-arc-out.ref ${TMPDIR}/ov2.out
-
-rm -f ${TMPDIR}/ov2.out
-gpsbabel -i geo -f ${REFERENCE}/gl.loc -o tomtom -F ${TMPDIR}/ov2.out
-compare ${REFERENCE}/ov2-geo-out.ref ${TMPDIR}/ov2.out
-
-# round trip test including CP-1252 conversion
-rm -f ${TMPDIR}/tomtom.gpx
-gpsbabel -i tomtom -f ${REFERENCE}/tomtom.ov2 -o gpx -F ${TMPDIR}/tomtom.gpx
-compare ${REFERENCE}/tomtom.gpx ${TMPDIR}/tomtom.gpx
-
-rm -f ${TMPDIR}/tomtom.ov2
-gpsbabel -i gpx -f ${REFERENCE}/tomtom.gpx -o tomtom -F ${TMPDIR}/tomtom.ov2
-bincompare ${REFERENCE}/tomtom.ov2 ${TMPDIR}/tomtom.ov2
+++ /dev/null
-
-#
-# TomTom Navigator Places of Interest (.asc)
-#
-gpsbabel -i tomtom_asc -f ${REFERENCE}/tomtom_poi.asc -o tomtom_asc -F ${TMPDIR}/tomtom_poi.asc
-compare ${REFERENCE}/tomtom_poi.asc ${TMPDIR}/tomtom_poi.asc
-
+++ /dev/null
-#
-# TomTom Navigator Itinerary files (.asc)
-#
-gpsbabel -i tomtom_itn -f ${REFERENCE}/route/tomtom_itn.itn -o tomtom_itn -F ${TMPDIR}/tomtom_itn.itn
-compare ${REFERENCE}/route/tomtom_itn.itn ${TMPDIR}/tomtom_itn.itn
-
+++ /dev/null
-rm -f ${TMPDIR}/wintec_tes.*
-
-# Currently one-way.
-gpsbabel -i wintec_tes -f ${REFERENCE}/track/wintec_tes.tes -o gpx -F ${TMPDIR}/wintec_tes.gpx
-compare ${REFERENCE}/track/wintec_tes~gpx.gpx ${TMPDIR}/wintec_tes.gpx
-
+++ /dev/null
-#
-# Swiss Map (.xol) tests
-#
-gpsbabel -i xol -f ${REFERENCE}/xol-sample.xol -o gpx -F ${TMPDIR}/xol-sample.gpx
-compare ${REFERENCE}/xol-sample.gpx ${TMPDIR}/xol-sample.gpx
-
-# check xmlgeneric can handle stdin
-rm -f ${TMPDIR}/xol-sample.gpx
-cat ${REFERENCE}/xol-sample.xol | gpsbabel -i xol -f - -o gpx -F ${TMPDIR}/xol-sample.gpx
-compare ${REFERENCE}/xol-sample.gpx ${TMPDIR}/xol-sample.gpx
-
-# check xmlgeneric can detect no input file
-# we expect this to fail
-rm -f ${TMPDIR}/xol-sample_si.gpx
-${VALGRIND} "${PNAME}" -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.gpx 2> ${TMPDIR}/nonexistent.err && {
- echo "${PNAME} succeeded! (it shouldn't have with this input...)"
-}
-# check error message is what we expected.
-# The message can vary depending on the c runtime, .i.e. msvc and gcc are slightly different.
-compare_with_alternate ${REFERENCE}/nonexistent.err ${REFERENCE}/nonexistent_alternate.err ${TMPDIR}/nonexistent.err
-
-
-gpsbabel -i gpx -f ${REFERENCE}/xol-sample.gpx -o xol -F ${TMPDIR}/xol-sample-gpx.xol
-compare ${REFERENCE}/xol-sample-gpx.xol ${TMPDIR}/xol-sample-gpx.xol
-
+++ /dev/null
-/*
- Read and write TomTom .ov2 files.
-
- Copyright (C) 2005 Ronald Parker (babeltomtom@parkrrrr.com) and
- Robert Lipe (robertlipe+source@gpsbabel.org)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-
-/*
- This module is based on my reverse-engineering of the .ov2 format, so
- it might not be aware of all record types. In particular, I've seen
- a type-3 record that may contain additional strings, but since I haven't
- seen any of those from a legitimate source, I don't know what they are
- supposed to contain. Thus, they are not currently supported. (The one
- I saw was due to an errant pair of double-quotes in the input to
- makeov2.exe.) -- Ron Parker, 28 April 2005
-
- Because they've been seen in the wild, I have updated the reader to
- deal with type 3 as if they were type 2. I still haven't seen any
- records that fill in the other two strings, so until I know for sure
- that they are indeed strings, I'm just putting them on the end of the
- description string beyond the NUL terminator. -- Ron Parker, 17 July 2006
-*/
-
-#include <cstdio> // for printf, snprintf, SEEK_CUR, EOF
-#include <cstdlib> // for qsort
-#include <cstring> // for strlen
-
-#include <QString> // for QString
-#include <QtGlobal> // for foreach
-
-#include "defs.h"
-#include "gbfile.h" // for gbfgetint32, gbfputint32, gbfclose, gbfgetc, gbfputc, gbfseek, gbfile, gbfeof, gbfread, gbftell, gbfwrite, gbfopen_le
-
-
-#define MYNAME "TomTom"
-
-static gbfile* file_in;
-static gbfile* file_out;
-
-static
-QVector<arglist_t> tomtom_args = {
-};
-
-static void
-rd_init(const QString& fname)
-{
- file_in = gbfopen_le(fname, "rb", MYNAME);
-}
-
-static void
-rd_deinit()
-{
- gbfclose(file_in);
-}
-
-static void
-wr_init(const QString& fname)
-{
- file_out = gbfopen_le(fname, "wb", MYNAME);
-}
-
-static void
-wr_deinit()
-{
- gbfclose(file_out);
-}
-
-#define read_long(f) gbfgetint32((f))
-#define read_char(f) gbfgetc((f))
-
-#ifdef DEAD_CODE_IS_REBORN
-/*
- * Decode a type 8 compressed record
- */
-static char*
-decode_8(int sz, const unsigned char* inbuf)
-{
- static const char encoding_8[] = "X. SaerionstldchumgpbkfzvACBMPG-";
- static const int encoding_8_high[8] = {0x2,0x3,0x4,0x5,0x6,0x7,0xe,0xf};
-
- // Maximally sized for laziness.
- char* rval = (char*) xmalloc(sz * 3 + 1);
- char* out = rval;
-
- int i;
- for (i = 0; i < sz;) {
- if (inbuf[0] & 0x80) {
- int idx;
- int res;
- idx = (inbuf[0] & 0x70) >> 4;
- res = inbuf[0] & 0x0f;
- res |= encoding_8_high[idx] << 4;
-
- *out++ = res;
-
- inbuf++;
- i++;
- } else {
- int c1 = (inbuf[0] & 0x7c) >> 2;
- int c2 = ((inbuf[0] & 3) << 3) | (inbuf[1] & 0xe0) >> 5;
- int c3 = inbuf[1] & 0x1f;
- if ((c1 | c2 | c3) > 0x1f) {
- fatal("bit unpacking error");
- }
- *out++ = encoding_8[c1];
- *out++ = encoding_8[c2];
- *out++ = encoding_8[c3];
- inbuf+=2;
- i+=2;
- }
- }
- return rval;
-}
-#endif
-
-#ifdef DEAD_CODE_IS_REBORN
-static void
-decode_latlon(double* lat, double* lon)
-{
- unsigned char latbuf[3];
- unsigned char lonbuf[3];
- double rlat, rlon;
-
- gbfread(&lonbuf, 3, 1, file_in);
- gbfread(&latbuf, 3, 1, file_in);
- rlat = ((latbuf[2] << 16) + (latbuf[1] << 8) + latbuf[0]) / 1000000.0;
-
- *lat = 80 - rlat;
- *lon = rlon = 123.456;
-
-}
-#endif
-
-static void
-check_recsize(int sz)
-{
- if ((sz > 100000) || (sz < 0)) {
- fatal(MYNAME ":malformed file. Bad record size.");
- }
-}
-
-static void
-data_read()
-{
- long recsize;
- long x;
- long y;
- char* desc;
- Waypoint* wpt_tmp;
- while (!gbfeof(file_in)) {
- int rectype = read_char(file_in);
- if (rectype == EOF) {
- fatal(MYNAME ":Unexpected EOF.");
- }
- if (global_opts.debug_level >= 5) {
- printf("Reading record type %d\n", rectype);
- }
- switch (rectype) {
- case 0:
- case 100:
- if (global_opts.debug_level >= 5) {
- printf("Skipping deleted record\n");
- }
- recsize = read_long(file_in) - 5;
- check_recsize(recsize);
- if (global_opts.debug_level >= 5) {
- printf("Skipping %li bytes\n", recsize);
- }
- gbfseek(file_in, recsize, SEEK_CUR);
- break;
- case 1:
- /* a block header; ignored on read */
- read_long(file_in);
- read_long(file_in);
- read_long(file_in);
- read_long(file_in);
- read_long(file_in);
- break;
- case 2:
- case 3:
- recsize = read_long(file_in);
- check_recsize(recsize);
- x = read_long(file_in);
- y = read_long(file_in);
- desc = (char*)xmalloc(recsize - 13);
- gbfread(desc, recsize-13, 1, file_in);
-
- wpt_tmp = new Waypoint;
-
- wpt_tmp->longitude = x/100000.0;
- wpt_tmp->latitude = y/100000.0;
- wpt_tmp->description = STRTOUNICODE(desc);
- xfree(desc);
- desc = nullptr;
- // TODO:: description in rectype 3 contains two zero-terminated strings
- // First is same as rectype 2, second apparently contains the unique ID of the waypoint
- // See http://www.tomtom.com/lib/doc/PRO/TTN6_SDK_documentation.zip
- if (rectype == 3) {
- warning("Unexpected waypoint record type %d encountered.\nThe unique ID of the POI may have been dropped.\n", rectype);
- }
-
- waypt_add(wpt_tmp);
- break;
- case 8:
- case 24:
-#if 0 // Fallthrough for now to silently ignore these until this is done.
- recsize = read_char(file_in) ;
- check_recsize(recsize);
- wpt_tmp = new Waypoint;
- decode_latlon(&wpt_tmp->latitude, &wpt_tmp->longitude);
- gbfread(tbuf, 3, 1, file_in);
- gbfread(tbuf, 3, 1, file_in);
- gbfread(tbuf, recsize, 1, file_in);
- wpt_tmp->shortname = decode_8(recsize, tbuf);
- waypt_add(wpt_tmp);
- break;
-#else
-#endif
- case 9:
- case 25:
- recsize = read_char(file_in) + 6;
- check_recsize(recsize);
- if (global_opts.debug_level >= 5)
- warning("Unknown record type 0x%x; skipping %ld bytes.\n",
- rectype, recsize);
- gbfseek(file_in, recsize, SEEK_CUR);
- break;
- default:
- if (global_opts.debug_level >= 1) {
- warning("Unexpected waypoint record type: %d at offset 0x%x\n", rectype, gbftell(file_in));
- }
- }
- }
-}
-
-
-struct hdr {
- const Waypoint* wpt;
-};
-
-static int compare_lon(const void* a, const void* b);
-
-static
-int
-compare_lat(const void* a, const void* b)
-{
- const auto* wa = (const struct hdr*) a;
- const auto* wb = (const struct hdr*) b;
-
- double difference = wa->wpt->latitude - wb->wpt->latitude;
- if (difference < 0) {
- return -1;
- }
- if (difference) {
- return 1;
- }
- if (wa->wpt->longitude - wb->wpt->longitude == 0) {
- return wa->wpt->shortname.compare(wb->wpt->shortname);
- }
- return compare_lon(a,b);
-}
-
-static
-int
-compare_lon(const void* a, const void* b)
-{
- const auto* wa = (const struct hdr*)a;
- const auto* wb = (const struct hdr*)b;
-
- double difference = wa->wpt->longitude - wb->wpt->longitude;
- if (difference < 0) {
- return -1;
- }
- if (difference) {
- return 1;
- }
- if (wa->wpt->latitude - wb->wpt->latitude == 0) {
- return wa->wpt->shortname.compare(wb->wpt->shortname);
- }
- return compare_lat(a,b);
-}
-
-#define write_long(f,v) gbfputint32((v),f)
-
-static void
-write_float_as_long(gbfile* file, double value)
-{
- long tmp = (value + 0.500000000001);
- write_long(file, tmp);
-}
-
-#define write_char(f,c) gbfputc((c),f)
-#define write_string(f,s) gbfwrite((s),1,strlen(s)+1,f)
-
-struct blockheader {
- struct hdr* start;
- long count;
- long size;
- double minlat;
- double maxlat;
- double minlon;
- double maxlon;
- struct blockheader* ch1;
- struct blockheader* ch2;
-};
-
-static void
-write_blocks(gbfile* f, struct blockheader* blocks)
-{
- write_char(f, 1);
- write_long(f, blocks->size);
- write_float_as_long(f, blocks->maxlon*100000);
- write_float_as_long(f, blocks->maxlat*100000);
- write_float_as_long(f, blocks->minlon*100000);
- write_float_as_long(f, blocks->minlat*100000);
- if (blocks->ch1) {
- write_blocks(f, blocks->ch1);
- }
- if (blocks->ch2) {
- write_blocks(f, blocks->ch2);
- }
- if (!blocks->ch1 && !blocks->ch2) {
- for (int i = 0; i < blocks->count; i++) {
- char desc_field [256];
- write_char(f, 2);
- if (global_opts.smart_names &&
- blocks->start[i].wpt->gc_data->diff &&
- blocks->start[i].wpt->gc_data->terr) {
- snprintf(desc_field,sizeof(desc_field),"%s(t%ud%u)%s(type%dcont%d)",STRFROMUNICODE(blocks->start[i].wpt->description),
- blocks->start[i].wpt->gc_data->terr/10,
- blocks->start[i].wpt->gc_data->diff/10,
- STRFROMUNICODE(blocks->start[i].wpt->shortname),
- (int) blocks->start[i].wpt->gc_data->type,
- (int) blocks->start[i].wpt->gc_data->container);
- //Unfortunately enums mean we get numbers for cache type and container.
- } else {
- snprintf(desc_field, sizeof(desc_field), "%s",
- STRFROMUNICODE(blocks->start[i].wpt->description));
- }
- write_long(f, strlen(desc_field) + 14);
- write_float_as_long(f, blocks->start[i].wpt->longitude*100000);
- write_float_as_long(f, blocks->start[i].wpt->latitude*100000);
- write_string(f, desc_field);
- }
- }
-}
-
-static struct blockheader*
-compute_blocks(struct hdr* start, int count,
- double minlon, double maxlon, double minlat, double maxlat)
-{
- auto* newblock = (struct blockheader*)xcalloc(1, sizeof(struct blockheader));
- newblock->start = start;
- newblock->count = count;
- newblock->minlon = minlon;
- newblock->maxlon = maxlon;
- newblock->minlat = minlat;
- newblock->maxlat = maxlat;
- newblock->size = 4 * 5 + 1; /* hdr is 5 longs, 1 char */
- if (count < 20) {
- for (int i = 0; i < count; i++) {
- newblock->size += 4 * 3 + 1;
- /* wpt const part 3 longs, 1 char */
- const Waypoint* wpt = start[i].wpt;
- newblock->size += wpt->description.length() + 1;
- }
- } else {
- if ((maxlat-minlat)>(maxlon-minlon)) {
- /* split along lats */
- qsort(start, count, sizeof(*start), compare_lat);
- newblock->ch1 = compute_blocks(start, count/2,
- minlon, maxlon, minlat,
- start[count/2].wpt->latitude);
- newblock->ch2 = compute_blocks(start+count/2,
- count-count/2, minlon, maxlon,
- start[count/2].wpt->latitude, maxlat);
- } else {
- /* split along lons */
- qsort(start, count, sizeof(*start), compare_lon);
- newblock->ch1 = compute_blocks(start, count/2,
- minlon, start[count/2].wpt->longitude,
- minlat, maxlat);
- newblock->ch2 = compute_blocks(start+count/2,
- count-count/2, start[count/2].wpt->longitude,
- maxlon, minlat, maxlat);
- }
- if (newblock->ch1) {
- newblock->size += newblock->ch1->size;
- }
- if (newblock->ch2) {
- newblock->size += newblock->ch2->size;
- }
- }
- return newblock;
-}
-
-static void
-free_blocks(struct blockheader* block)
-{
- if (block->ch1) {
- free_blocks(block->ch1);
- }
- if (block->ch2) {
- free_blocks(block->ch2);
- }
- xfree(block);
-}
-
-static void
-data_write()
-{
- int ct = waypt_count();
- struct hdr* htable, *bh;
- extern WaypointList* global_waypoint_list;
- double minlon = 200;
- double maxlon = -200;
- double minlat = 200;
- double maxlat = -200;
- struct blockheader* blocks = nullptr;
-
- htable = (struct hdr*) xmalloc(ct * sizeof(*htable));
- bh = htable;
-
- // Iterate with waypt_disp_all?
- for (const Waypoint* waypointp : qAsConst(*global_waypoint_list)) {
- bh->wpt = waypointp;
- if (waypointp->longitude > maxlon) {
- maxlon = waypointp->longitude;
- }
- if (waypointp->longitude < minlon) {
- minlon = waypointp->longitude;
- }
- if (waypointp->latitude > maxlat) {
- maxlat = waypointp->latitude;
- }
- if (waypointp->latitude < minlat) {
- minlat = waypointp->latitude;
- }
- bh ++;
- }
-
- blocks = compute_blocks(htable, ct, minlon, maxlon, minlat, maxlat);
- write_blocks(file_out, blocks);
- free_blocks(blocks);
-
- xfree(htable);
-}
-
-ff_vecs_t tomtom_vecs = {
- ff_type_file,
- FF_CAP_RW_WPT,
- rd_init,
- wr_init,
- rd_deinit,
- wr_deinit,
- data_read,
- data_write,
- nullptr,
- &tomtom_args,
- CET_CHARSET_MS_ANSI, 0 /* CET-REVIEW */
- , NULL_POS_OPS
-};
remove_line_containing $1 reference/format0.txt
remove_line_containing $1 reference/format1.txt
remove_line_containing $1 reference/format2.txt
+remove_line_containing $1 gpsbabel.qrc
git rm -f reference/$1*
git rm -f xmldoc/formats/$1.xml
git rm -f xmldoc/formats/options/$1.xml
git rm -f testo.d/$1.test
-git rm -f style/$1.test
+git rm -f style/$1.style
[ -f $1.cc ] && git mv $1.cc deprecated/
[ -f $1.h ] && git mv $1.h deprecated/
[ -f style/$1.style ] && git mv style/$1.style deprecated/style/
#include "skytraq.h" // for MinihomerFormat, SkytraqFormat, SkytraqfileFormat
#include "src/core/logging.h" // for Warning, FatalMsg
#include "subrip.h" // for SubripFormat
-#include "teletype.h" // for TeletypeFormat
#include "text.h" // for TextFormat
#include "unicsv.h" // for UnicsvFormat
-#include "wintec_tes.h" // for WintecTesFormat
#include "xcsv.h" // for XcsvStyle, XcsvFormat
extern ff_vecs_t wbt_fvecs;
//extern ff_vecs_t wbt_fvecs;
extern ff_vecs_t vcf_vecs;
-extern ff_vecs_t tomtom_vecs;
extern ff_vecs_t gtm_vecs;
extern ff_vecs_t gpssim_vecs;
#if CSVFMTS_ENABLED
extern ff_vecs_t garmin_txt_vecs;
#endif // CSVFMTS_ENABLED
-extern ff_vecs_t dmtlog_vecs;
-extern ff_vecs_t raymarine_vecs;
extern ff_vecs_t ggv_log_vecs;
-extern ff_vecs_t xol_vecs;
extern ff_vecs_t navilink_vecs;
-extern ff_vecs_t navitel_trk_vecs;
-extern ff_vecs_t itracku_vecs;
-extern ff_vecs_t itracku_fvecs;
extern ff_vecs_t sbp_vecs;
extern ff_vecs_t sbn_vecs;
extern ff_vecs_t v900_vecs;
LegacyFormat wbt_ffmt {wbt_fvecs};
//LegacyFormat wbt_ffmt {wbt_fvecs};
LegacyFormat vcf_fmt {vcf_vecs};
- LegacyFormat tomtom_fmt {tomtom_vecs};
UnicsvFormat unicsv_fmt;
LegacyFormat gtm_fmt {gtm_vecs};
LegacyFormat gpssim_fmt {gpssim_vecs};
LegacyFormat garmin_txt_fmt {garmin_txt_vecs};
#endif // CSVFMTS_ENABLED
GtrnctrFormat gtc_fmt;
- LegacyFormat dmtlog_fmt {dmtlog_vecs};
- LegacyFormat raymarine_fmt {raymarine_vecs};
GarminGPIFormat garmin_gpi_fmt;
RandomFormat random_fmt;
- LegacyFormat xol_fmt {xol_vecs};
Dg100SerialFormat dg100_fmt;
Dg100FileFormat dg100_ffmt;
Dg200SerialFormat dg200_fmt;
ExifFormat exif_fmt;
HumminbirdFormat humminbird_fmt;
HumminbirdHTFormat humminbird_ht_fmt;
- LegacyFormat navitel_trk_fmt {navitel_trk_vecs};
- LegacyFormat itracku_fmt {itracku_vecs};
- LegacyFormat itracku_ffmt {itracku_fvecs};
LegacyFormat sbp_fmt {sbp_vecs};
LegacyFormat sbn_fmt {sbn_vecs};
LegacyFormat v900_fmt {v900_vecs};
SkytraqFormat skytraq_fmt;
- TeletypeFormat teletype_fmt;
SkytraqfileFormat skytraq_ffmt;
MinihomerFormat miniHomer_fmt;
- WintecTesFormat wintec_tes_fmt;
SubripFormat subrip_fmt;
LegacyFormat format_garmin_xt_fmt {format_garmin_xt_vecs};
GarminFitFormat format_fit_fmt;
"vcf",
nullptr,
},
- {
- &tomtom_fmt,
- "tomtom",
- "TomTom POI file (.ov2)",
- "ov2",
- nullptr,
- },
{
&unicsv_fmt,
"unicsv",
"tcx/crs/hst/xml",
nullptr,
},
- {
- &dmtlog_fmt,
- "dmtlog",
- "TrackLogs digital mapping (.trl)",
- "trl",
- nullptr,
- },
- {
- &raymarine_fmt,
- "raymarine",
- "Raymarine Waypoint File (.rwf)",
- "rwf",
- nullptr,
- },
{
&garmin_gpi_fmt,
"garmin_gpi",
nullptr,
nullptr,
},
- {
- &xol_fmt,
- "xol",
- "Swiss Map 25/50/100 (.xol)",
- "xol",
- nullptr,
- },
{
&dg100_fmt,
"dg-100",
"ht",
nullptr,
},
- {
- &navitel_trk_fmt,
- "navitel_trk",
- "Navitel binary track (.bin)",
- "bin",
- nullptr,
- },
- {
- &itracku_fmt,
- "itracku",
- "XAiOX iTrackU Logger",
- nullptr,
- nullptr,
- },
- {
- &itracku_ffmt,
- "itracku-bin",
- "XAiOX iTrackU Logger Binary File Format",
- "bin",
- nullptr,
- },
{
&sbp_fmt,
"sbp",
nullptr,
nullptr,
},
- {
- &teletype_fmt,
- "teletype",
- "Teletype [ Get Jonathon Johnson to describe",
- nullptr,
- nullptr,
- },
{
&skytraq_ffmt,
"skytraq-bin",
nullptr,
nullptr,
},
- {
- &wintec_tes_fmt,
- "wintec_tes",
- "Wintec TES file",
- "tes",
- nullptr,
- },
{
&subrip_fmt,
"subrip",
+++ /dev/null
-/*
-
- Wintec tes support.
-
- Copyright (C) 2010 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-#include "wintec_tes.h"
-
-#include <ctime> // for time_t, tm
-#include <cstring> // for memset
-
-#include "defs.h" // for Waypoint, mkgmtime, track_add_head, track_add_wpt, waypt_add, route_head
-
-
-#define MYNAME "wintec_tes"
-
-void
-WintecTesFormat::rd_init(const QString& fname)
-{
- fin = gbfopen(fname, "r", MYNAME);
-}
-
-void
-WintecTesFormat::rd_deinit()
-{
- gbfclose(fin);
-}
-
-time_t
-WintecTesFormat::wintec_date_to_time(uint32_t w)
-{
- struct tm tm;
- memset(&tm, 0, sizeof(tm));
- tm.tm_sec = ((w & 0x0000003f));
- tm.tm_min = ((w & 0x00000fc0) >> 6);
- tm.tm_hour = ((w & 0x0001f000) >> 12);
- tm.tm_mday = ((w & 0x003f0000) >> 17);
- tm.tm_mon = ((w & 0x03c00000) >> 22) - 1;
- tm.tm_year = ((w & 0xfc000000) >> 26) + 100;
-
- return mkgmtime(&tm);
-}
-
-void
-WintecTesFormat::read()
-{
- auto* trk = new route_head;
- track_add_head(trk);
-
- while (!gbfeof(fin)) {
- uint16_t flags = gbfgetuint16(fin);
- uint32_t date = gbfgetuint32(fin);
- int32_t latitude = gbfgetint32(fin);
- int32_t longitude = gbfgetint32(fin);
- int16_t alt = gbfgetint16(fin); // Signed. Meters.
-
- (void) flags; // Silence 'unused' warning until we use flags.
- auto* wpt = new Waypoint;
- wpt->latitude = latitude / 1.0e7;
- wpt->longitude = longitude / 1.0e7;
- wpt->SetCreationTime(wintec_date_to_time(date));
- // The unit of altitude isn't clear and we have a lot of
- // samples with wildly negative values, so ignore those for now.
- wpt->altitude = alt;
-
- // The description given to us says this is a bitmask with
- // 0x01 "split mark" (not at all clear what that is)
- // 0x02 interest point
- // 0x04 track point
- // But of the files we've seen, none have had > 1 bit set
- // and none have had 0x04 set.
- // Wintec's software puts a waypoint in the track, so we
- // mock that.
- if (flags & 0x02) {
- auto* temp = new Waypoint(*wpt);
- waypt_add(temp);
- }
-
- track_add_wpt(trk, wpt);
- }
-}
+++ /dev/null
-/*
-
- Wintec tes support.
-
- Copyright (C) 2010 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-#ifndef WINTEC_TES_H_INCLUDED_
-#define WINTEC_TES_H_INCLUDED_
-
-#include <QString> // for QString
-#include <QVector> // for QVector
-
-#include <cstdint> // for uint32_t
-#include <ctime> // for time_t
-
-#include "defs.h" // for ff_cap, arglist_t, ff_cap_read, CET_CHARSET_ASCII, ff_cap_none, ff_type, ff_type_file
-#include "format.h" // for Format
-#include "gbfile.h" // for gbfile
-
-
-class WintecTesFormat : public Format
-{
-public:
- QVector<arglist_t>* get_args() override
- {
- return &wintec_tes_args;
- }
-
- ff_type get_type() const override
- {
- return ff_type_file;
- }
-
- QVector<ff_cap> get_cap() const override
- {
- /* waypoints, tracks, routes */
- return { ff_cap_read, ff_cap_read, ff_cap_none };
- }
-
- QString get_encode() const override
- {
- return CET_CHARSET_ASCII;
- }
-
- int get_fixed_encode() const override
- {
- return 0;
- }
-
- void rd_init(const QString& fname) override;
- void read() override;
- void rd_deinit() override;
-
-private:
- /* Member Functions */
-
- static time_t wintec_date_to_time(uint32_t w);
-
- /* Data Members */
-
- gbfile* fin{};
-
- QVector<arglist_t> wintec_tes_args = {
- };
-
-};
-#endif // WINTEC_TES_H_INCLUDED_
+++ /dev/null
-<para>
- This format can be used to convert files from
- <ulink url="http://www.tracklogs.co.uk">TrackLogs Digital Mapping</ulink>. The files
- have extension .trl and can contain waypoints and tracks.
-</para>
-<para>
- We have seen three different types of this format. Two are binary
- and one is an XML based format. All three types are supported
- by our reader.
-</para>
-<para>
-Users should note that this format orders waypoints in reverse order within the file. If direction of travel is important to you, consider using the Reverse filter to retain waypoint order.
-</para>
+++ /dev/null
-<para>
- Navitrak DNA marker format - Another CSV format file. This
- is the format that is compatible with the DNA Desktop import/export
- command. Reading the binary Markers.jwp format directly off the data
- card is not supported yet. Contributed by Tim Zickus.
-</para>
-
+++ /dev/null
-<para>Serial download protocol for the <productname><ulink url="http://www.xaiox.com/itracku_sirf3.htm">XAiOX iTrackU BLUETOOTH GPS-RECEIVER SiRF III</ulink></productname> data logger.</para>
-<example id="itracku-download">
- <title>Command showing a download from itracku connected to com14.</title>
- <para><userinput>gpsbabel -i itracku -f com14 -o gpx -F out.gpx</userinput></para>
-</example>
-<para>Use auto: as input filename to let gpsbabel detect the serial port to which the logger is connected.</para>
-<example id="itracku-download-auto">
- <title>Command showing a download from itracku with automatic port detection.</title>
- <para><userinput>gpsbabel -i itracku -f auto: -o gpx -F out.gpx</userinput></para>
-</example>
+++ /dev/null
-<para>
- This format supports the "Raymarine Waypoint File" format (.rwf).
- More information to Raymarine you'll find at their <ulink url="http://www.raymarine.com">homepage</ulink>.
-</para>
-<para>
- Known limits: max. 16 characters for waypoint names and max. 50 waypoints per route.
-</para>
+++ /dev/null
-<para> This is a format for creating data to be read by
- <ulink url="http://www.microsoft.com/streets/default.mspx"> Microsoft Streets and
- Trips</ulink>. It's been exercised on versions from 2003 through 2008. Detailed
- instructions on how to use it, including preserving hyperlinks, are at
- <ulink url="/formats/s_and_t/Importing_into_Microsoft_Streets_and_Trips_2003.html">gpsbabel.org</ulink>
-</para>
-<para>
- We have an additional page describing how to solve the
- <ulink url="/formats/s_and_t/TripPlanning.html">traveling salesman problem with
- Streets & Trips</ulink> to efficiently optimize a trip with many stops, such as
- is often made by geocachers.
-</para>
-<!--
-<para>
- This format has nothing to do with the <link linkend="fmt_msroute1"> .est/axe format</link>
- used by this program to store routes.
-</para>
--->
-<para>
- Since modern versions of Streets and Trips support reading GPX, this format is probably
- not so useful.
-</para>
-
+++ /dev/null
-<para>
-This format reads the files written by the <ulink url="http://teletype.com">Teletype</ulink> GPS devices with the extension of ".way".
-</para>
-<para>
- It's not entirely clear exactly which Teletype products are supported or
- what versions write the format we read.
-</para>
+++ /dev/null
-
-
-
- <para> This format can read and write <ulink url="http://www.tomtom.com">TomTom</ulink> .ov2 (POI) files,
-as used by the TomTom GO and TomTom Navigator. It has been tested
-with an original TomTom GO running version 5.00 of the TomTom
-software. There may be some records that confuse the input module -
-if you have an example of such a record "in the wild", and you aren't
-restricted from sharing it, we encourage you to post to the
-gpsbabel-misc mailing list to contact a developer.</para>
- <para> Note that in addition to the .ov2 file, you will need a
-.bmp file for the icon. It should be 22x22 and 16 colors, and have
-the same name (not including the extension) as the .ov2 file.
-</para>
-
+++ /dev/null
-<para>This format supports Wintec .tec files, such as appear on the
-<productname>Wintec WBT-202</productname> data logger.
-</para>
-<para>
-The WinTec WBT-202 stores tracks and waypoints on an internal
-MICRO-SD Memory card. The log files can be accessed by connecting to an USB
-host and setting the device into a mass storage device (MSD) mode. To enter
-this mode, attach it to the computer, then hold the power button until the
-GPS and Bluetooth LEDs go out. It will then behave like an USB Memory stick.
-and individual files containing your tracks will show up on the "disk" with
-names ending in .tes. You can use GPSBabel to read these files directly
-or copy them to your host computer.
-</para>
-<para>
-Note that this format is for the TES files on the GPS, it has no relationship
-to the .TK2 files created by Wintec's Time Machine software for Windows.
-</para>
-<para>
-Despite the physical similarity to the
-<productname>Wintec WBT-201</productname>, this is believed to be a rather
-different product. While this GPS probably works fine for
-<link linkend="tracking">realtime tracking</link> over the bluetooth or
-serial lines (once you have appropriate serial drivers), it's expected
-to not work with GPSBabel's <link linkend="fmt_wbt">GPSBabel WBT
-Protocol</link> module.
-</para>
+++ /dev/null
-<para>
- This module reads and writes XML based (.xol) files used by
- <ulink url="https://www.swisstopo.admin.ch">Swiss Map</ulink> software.
-</para>
-<para>
- These files use the "Swiss National Grid" (CH-1903) to store coordinates.
-</para>
+++ /dev/null
-/*
-
- Support for Swiss Map # (.xol) format
-
- Copyright (C) 2007 Olaf Klein, o.b.klein@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-*/
-
-#include "defs.h"
-#include "garmin_tables.h"
-#include "jeeps/gpsmath.h"
-#include "src/core/file.h"
-#include "src/core/xmlstreamwriter.h"
-#include "xmlgeneric.h"
-
-#include <QXmlStreamAttributes>
-#include <QXmlStreamWriter>
-
-static Waypoint* wpt_;
-static route_head* trk_;
-static bounds all_bounds;
-static short_handle short_h;
-
-static gpsbabel::File* oqfile;
-static gpsbabel::XmlStreamWriter* writer;
-
-static QVector<arglist_t> xol_args = {};
-
-#define MYNAME "xol"
-
-static xg_callback xol_shape, xol_shape_end;
-static xg_callback xol_waypt, xol_overlay;
-
-#define XOL "/overlays/overlay"
-
-static xg_tag_mapping xol_map[] = {
- { xol_overlay, cb_start, XOL },
- { xol_shape, cb_start, XOL "/shapes/*shape" },
- { xol_shape_end, cb_end, XOL "/shapes/*shape" },
- { xol_waypt, cb_start, XOL "/shapes/shape/*points/point" },
- { nullptr, (xg_cb_type)0, nullptr} };
-
-static void xol_overlay(xg_string, const QXmlStreamAttributes* attrv) {
- if (attrv->hasAttribute("version")) {
- if (attrv->value("version") != u"1.0") {
- fatal(MYNAME ": Unsupported version %s.\n",
- qPrintable(attrv->value("version").toString()));
- }
- }
-}
-
-static void xol_shape(xg_string, const QXmlStreamAttributes* attrv) {
- if (attrv->hasAttribute("type")) {
- if (attrv->value("type") == u"waypoint") {
- wpt_ = new Waypoint;
- } else if (attrv->value("type") == u"polyline") {
- trk_ = new route_head;
- track_add_head(trk_);
- }
- }
-
- if (attrv->hasAttribute("name")) {
- if (wpt_) {
- wpt_->shortname = attrv->value("name").toString();
- } else if (trk_) {
- trk_->rte_name = attrv->value("name").toString();
- }
- }
-
- if (wpt_) {
- if (attrv->hasAttribute("comment")) {
- wpt_->notes = attrv->value("comment").toString();
- }
-
- if (attrv->hasAttribute("alt")) {
- wpt_->altitude = attrv->value("alt").toDouble();
- }
-
- if (attrv->hasAttribute("timestamp")) {
- wpt_->creation_time = xml_parse_time(
- attrv->value("timestamp").toString());
- }
-
- if (attrv->hasAttribute("icon")) {
- wpt_->icon_descr = attrv->value("icon").toString();
- }
- }
-}
-
-static void xol_shape_end(xg_string, const QXmlStreamAttributes*) {
- if (wpt_) {
- if (trk_) {
- track_add_wpt(trk_, wpt_);
- } else {
- waypt_add(wpt_);
- }
- wpt_ = nullptr;
- } else if (trk_) {
- if (trk_->rte_waypt_ct() == 0) {
- track_del_head(trk_);
- }
- trk_ = nullptr;
- }
-}
-
-static void xol_waypt(xg_string, const QXmlStreamAttributes* attrv) {
- int x = 0, y = 0;
-
- if (attrv->hasAttribute("y")) {
- y = attrv->value("y").toInt();
- }
-
- if (attrv->hasAttribute("x")) {
- x = attrv->value("x").toInt();
- }
-
- GPS_Math_Swiss_EN_To_WGS84(x, y, &wpt_->latitude, &wpt_->longitude);
-}
-
-static void xol_rd_init(const QString& fname) {
- trk_ = nullptr;
- wpt_ = nullptr;
-
- xml_init(fname, xol_map, nullptr);
-}
-
-static void xol_read() { xml_read(); }
-
-static void xol_rd_deinit() { xml_deinit(); }
-
-/* writer */
-
-static void xol_fatal_outside(const Waypoint* waypoint) {
- fatal(MYNAME ": %s (%s) is outside of convertible area \"%s\"!\n",
- waypoint->shortname.isEmpty() ? "Waypoint" : qPrintable(waypoint->shortname),
- pretty_deg_format(waypoint->latitude, waypoint->longitude, 'd', nullptr, 0),
- gt_get_mps_grid_longname(grid_swiss, MYNAME));
-}
-
-static void xol_waypt_bound_calc(const Waypoint* waypoint) {
- waypt_add_to_bounds(&all_bounds, waypoint);
-}
-
-static void xol_wr_init(const QString& fname) {
- oqfile = new gpsbabel::File(fname);
- oqfile->open(QIODevice::WriteOnly | QIODevice::Text);
-
- writer = new gpsbabel::XmlStreamWriter(oqfile);
- writer->setAutoFormattingIndent(2);
- writer->writeStartDocument();
-
- waypt_init_bounds(&all_bounds);
- short_h = mkshort_new_handle();
-
- setshort_length(short_h, 1024); /* ??? */
- setshort_badchars(short_h, "\r\n\t");
- setshort_mustupper(short_h, 0);
- setshort_mustuniq(short_h, 1);
- setshort_whitespace_ok(short_h, 1);
- setshort_repeating_whitespace_ok(short_h, 1);
- setshort_defname(short_h, "Waypoint");
-}
-
-static void xol_wr_deinit() {
- mkshort_del_handle(&short_h);
- writer->writeEndDocument();
- delete writer;
- writer = nullptr;
-
- oqfile->close();
- delete oqfile;
- oqfile = nullptr;
-}
-
-static void xol_waypt_disp_cb(const Waypoint* wpt) {
- double x, y;
-
- QString name = wpt->shortname;
- if (name.isEmpty() || global_opts.synthesize_shortnames) {
- name = mkshort_from_wpt(short_h, wpt);
- } else {
- name = mkshort(short_h, name);
- }
-
- if (!GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &x, &y)) {
- xol_fatal_outside(wpt);
- }
- writer->writeStartElement(QStringLiteral("shape"));
- writer->writeAttribute(QStringLiteral("type"), QStringLiteral("waypoint"));
- writer->writeAttribute(QStringLiteral("name"), name);
- writer->writeAttribute(QStringLiteral("comment"), wpt->notes);
- writer->writeAttribute(QStringLiteral("icon"), wpt->icon_descr);
-
- if (wpt->creation_time.isValid()) {
- writer->writeAttribute(QStringLiteral("timestamp"), wpt->CreationTimeXML());
- }
- if (wpt->altitude != unknown_alt) {
- writer->writeAttribute(QStringLiteral("alt"), QString::number(wpt->altitude, 'f', 6));
- }
- writer->writeStartElement(QStringLiteral("points"));
- writer->writeStartElement(QStringLiteral("point"));
- writer->writeAttribute(QStringLiteral("x"), QString::number(x));
- writer->writeAttribute(QStringLiteral("y"), QString::number(y));
- writer->writeEndElement(); // point
- writer->writeEndElement(); // points
- writer->writeEndElement(); // shape
-}
-
-static void xol_track_hdr_disp_cb(const route_head*) {
- writer->writeStartElement(QStringLiteral("shape"));
- writer->writeAttribute(QStringLiteral("type"), QStringLiteral("polyline"));
- writer->writeAttribute(QStringLiteral("lineSize"), QStringLiteral("3"));
- writer->writeAttribute(QStringLiteral("lineColor"), QStringLiteral("#e60000"));
- writer->writeAttribute(QStringLiteral("lineStyle"), QStringLiteral("solid"));
- writer->writeStartElement(QStringLiteral("waypoints"));
-}
-
-static void xol_track_tlr_disp_cb(const route_head*) {
- writer->writeEndElement(); // waypoints
- writer->writeEndElement(); // shape
-}
-
-static void xol_trkpt_disp_cb(const Waypoint* wpt) {
- double x, y;
-
- if (!GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &x, &y)) {
- xol_fatal_outside(wpt);
- }
-
- writer->writeStartElement(QStringLiteral("shape"));
- writer->writeAttribute(QStringLiteral("type"), QStringLiteral("waypoint"));
- if (wpt->creation_time.isValid()) {
- writer->writeAttribute(QStringLiteral("timestamp"), wpt->CreationTimeXML());
- }
- if (wpt->altitude != unknown_alt) {
- writer->writeAttribute(QStringLiteral("alt"), QString::number(wpt->altitude, 'f'));
- }
-
- writer->writeStartElement(QStringLiteral("points"));
- writer->writeStartElement(QStringLiteral("point"));
- writer->writeAttribute(QStringLiteral("x"), QString::number(x));
- writer->writeAttribute(QStringLiteral("y"), QString::number(y));
- writer->writeEndElement(); // point
- writer->writeEndElement(); // points
- writer->writeEndElement(); // shape
-}
-
-static void xol_write() {
- double x, y;
-
- waypt_disp_all(xol_waypt_bound_calc);
- track_disp_all(nullptr, nullptr, xol_waypt_bound_calc);
-
- if (!waypt_bounds_valid(&all_bounds)) {
- fatal(MYNAME ": No data available!\n");
- }
-
- if (!GPS_Math_WGS84_To_Swiss_EN((all_bounds.min_lat + all_bounds.max_lat) / 2,
- (all_bounds.min_lon + all_bounds.max_lon) / 2,
- &x, &y)) {
- fatal(MYNAME
- ": At least one point is outside of convertible area \"%s\"!\n",
- gt_get_mps_grid_longname(grid_swiss, MYNAME));
- }
-
- writer->setAutoFormatting(true);
- writer->writeStartElement(QStringLiteral("overlays"));
- writer->writeStartElement(QStringLiteral("overlay"));
- writer->writeAttribute(QStringLiteral("version"), QStringLiteral("1.0"));
- writer->writeStartElement(QStringLiteral("center"));
- writer->writeAttribute(QStringLiteral("x"), QString::number(x));
- writer->writeAttribute(QStringLiteral("y"), QString::number(y));
- writer->writeEndElement(); // center
- writer->writeStartElement(QStringLiteral("shapes"));
-
- waypt_disp_all(xol_waypt_disp_cb);
- track_disp_all(xol_track_hdr_disp_cb, xol_track_tlr_disp_cb,
- xol_trkpt_disp_cb);
-
- writer->writeEndElement(); // shapes
- writer->writeEndElement(); // overlay
-}
-
-ff_vecs_t xol_vecs = {ff_type_file,
- {(ff_cap)(ff_cap_read | ff_cap_write), /* waypoints */
- (ff_cap)(ff_cap_read | ff_cap_write), /* tracks */
- ff_cap_none}, /* routes */
- xol_rd_init,
- xol_wr_init,
- xol_rd_deinit,
- xol_wr_deinit,
- xol_read,
- xol_write,
- nullptr,
- &xol_args,
- CET_CHARSET_UTF8,
- 0 , NULL_POS_OPS
-};